@@ -4,10 +4,37 @@ set -euo pipefail
44SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
55REPO_DIR=" $SCRIPT_DIR "
66
7- if [[ $# -gt 1 ]]; then
8- echo " Usage: ./install.sh [target-directory]" >&2
9- exit 1
10- fi
7+ usage () {
8+ echo " Usage: ./install.sh [--full] [target-directory]" >&2
9+ }
10+
11+ full_mode=0
12+ user_target=" "
13+ while [[ $# -gt 0 ]]; do
14+ case " $1 " in
15+ --full)
16+ full_mode=1
17+ shift
18+ ;;
19+ -h|--help)
20+ usage
21+ exit 0
22+ ;;
23+ --* )
24+ echo " Unknown option: $1 " >&2
25+ usage
26+ exit 1
27+ ;;
28+ * )
29+ if [[ -n " $user_target " ]]; then
30+ usage
31+ exit 1
32+ fi
33+ user_target=" $1 "
34+ shift
35+ ;;
36+ esac
37+ done
1138
1239if ! command -v temporal > /dev/null 2>&1 ; then
1340 echo " temporal CLI is required but was not found in PATH." >&2
@@ -16,8 +43,7 @@ if ! command -v temporal >/dev/null 2>&1; then
1643fi
1744
1845default_target_base=" ${ZSH_CUSTOM:- ${ZSH:- $HOME / .oh-my-zsh} / custom} /plugins"
19- if [[ $# -eq 1 ]]; then
20- user_target=" $1 "
46+ if [[ -n " $user_target " ]]; then
2147 if [[ " $( basename " $user_target " ) " == " temporalctx" ]]; then
2248 target_dir=" $user_target "
2349 else
7399 echo " Config already exists at $config_file "
74100fi
75101
102+ if [[ " $full_mode " == " 1" ]]; then
103+ zshc_dir=" ${ZSHC:- $HOME / .config/ zsh} "
104+ helper_source=" $target_dir /temporalctx.full.zsh"
105+ helper_target=" $zshc_dir /temporal.zsh"
106+ mkdir -p " $zshc_dir "
107+ if [[ ! -f " $helper_source " ]]; then
108+ echo " Could not find opinionated helpers at $helper_source " >&2
109+ exit 1
110+ fi
111+ ln -sfn " $helper_source " " $helper_target "
112+ echo " Installed opinionated helpers at $helper_target "
113+ fi
114+
76115echo
77116echo " Installation complete."
78117echo " Add temporalctx to your Oh My Zsh plugins list, for example:"
0 commit comments