@@ -16,33 +16,26 @@ echo_failed_command() {
16
16
}
17
17
trap echo_failed_command EXIT
18
18
19
-
20
19
# Global variables
21
- ASTRA_VERSION=" 5.15.0"
22
- ASTRA_PLATFORM=$( uname)
23
-
24
- if [ -z " $ASTRA_DIR " ]; then
25
- ASTRA_DIR=" $HOME /.astra"
26
- ASTRA_DIR_RAW=' $HOME/.astra'
27
- else
28
- ASTRA_DIR_RAW=" $ASTRA_DIR "
29
- fi
20
+ ASTRA_CLI_VERSION=" 0.3.2-alpha1"
21
+ ASTRA_CLI_PLATFORM=$( uname)
22
+ ASTRA_CLI_DIR=" $HOME /.astra/cli"
23
+ ASTRA_CLI_DIR_RAW=' $HOME/.astra/cli'
30
24
31
25
# Local variables
32
- astra_tmp_folder=" ${ASTRA_DIR} /tmp"
33
- astra_zip_file=" ${astra_tmp_folder} /astra-cli-${ASTRA_VERSION } .zip"
34
- astra_zip_base_folder=" ${astra_tmp_folder} /astra-cli-${ASTRA_VERSION } "
26
+ astra_tmp_folder=" $HOME /.astra /tmp"
27
+ astra_zip_file=" ${astra_tmp_folder} /astra-cli-${ASTRA_CLI_VERSION } .zip"
28
+ astra_zip_base_folder=" ${astra_tmp_folder} /astra-cli-${ASTRA_CLI_VERSION } "
35
29
36
- astra_config_file= " ${ASTRA_DIR} /config "
30
+ # Config Files
37
31
astra_bash_profile=" ${HOME} /.bash_profile"
38
32
astra_profile=" ${HOME} /.profile"
39
33
astra_bashrc=" ${HOME} /.bashrc"
40
34
astra_zshrc=" ${ZDOTDIR:- ${HOME} } /.zshrc"
41
-
42
35
astra_init_snippet=$( cat << EOF
43
36
#THIS MUST BE AT THE END OF THE FILE FOR ASTRA TO WORK!!!
44
- export ASTRADIR="$ASTRADIR_RAW "
45
- [[ -s "${ASTRA_DIR_RAW} /bin/ astra-init.sh" ]] && source "${ASTRA_DIR_RAW} /bin /astra-init.sh"
37
+ export ASTRADIR="$ASTRA_CLI_DIR_RAW "
38
+ [[ -s "${ASTRADIR} / astra-init.sh" ]] && source "${ASTRADIR} /astra-init.sh"
46
39
EOF
47
40
)
48
41
@@ -75,7 +68,7 @@ if [ -d "$ASTRA_DIR" ]; then
75
68
echo " You already have ASTRA-CLI installed."
76
69
echo " ASTRA-CLI was found at:"
77
70
echo " "
78
- echo " ${ASTRA_DIR } "
71
+ echo " ${ASTRA_CLI_DIR } "
79
72
echo " "
80
73
echo " Please delete this folder if you need to upgrade."
81
74
echo " ======================================================================================================"
@@ -150,20 +143,19 @@ else
150
143
fi
151
144
fi
152
145
153
- echo " Installing ASTRA-CLI scripts..."
154
-
146
+ echo " Installing Astra Cli scripts..."
155
147
156
148
# Create directory structure
157
149
158
150
echo " Create distribution directories..."
159
151
mkdir -p " $astra_tmp_folder "
152
+ mkdir -p " $ASTRA_CLI_DIR_RAW "
160
153
161
154
# script cli distribution
162
155
echo " Installing script cli archive..."
163
156
# fetch distribution
164
157
download_url=" ${ASTRA_SERVICE} /...."
165
- astra_zip_file=" ${astra_tmp_folder} /sdkman-${ASTRAVERSION} .zip"
166
- astra_zip_base_folder=" ${astra_tmp_folder} /sdkman-${ASTRA)VERSION} "
158
+ astra_zip_file=" ${astra_tmp_folder} /astra-cli-${ASTRAVERSION} .zip"
167
159
echo " * Downloading..."
168
160
curl --fail --location --progress-bar " $download_url " > " $astra_zip_file "
169
161
@@ -201,21 +193,20 @@ rm -rf "$astra_zip_file"
201
193
echo " "
202
194
203
195
204
- echo " Set version to $ASTRA_VERSION ..."
205
- echo " $ASTRA_VERSION " > " ${ASTRA_DIR} /var/version"
206
-
196
+ echo " Set version to $ASTRA_CLI_VERSION ..."
197
+ echo " $ASTRA_CLI_VERSION " > " ${ASTRA_CLI_DIR} /var/version"
207
198
208
199
if [[ $darwin == true ]]; then
209
200
touch " $astra_bash_profile "
210
201
echo " Attempt update of login bash profile on OSX..."
211
- if [[ -z $( grep ' sdkman -init.sh' " $astra_bash_profile " ) ]]; then
202
+ if [[ -z $( grep ' astra -init.sh' " $astra_bash_profile " ) ]]; then
212
203
echo -e " \n$astra_init_snippet " >> " $astra_bash_profile "
213
204
echo " Added astra init snippet to $astra_bash_profile "
214
205
fi
215
206
else
216
207
echo " Attempt update of interactive bash profile on regular UNIX..."
217
208
touch " ${astra_bashrc} "
218
- if [[ -z $( grep ' sdkman -init.sh' " $astra_bashrc " ) ]]; then
209
+ if [[ -z $( grep ' astra -init.sh' " $astra_bashrc " ) ]]; then
219
210
echo -e " \n$astra_init_snippet " >> " $astra_bashrc "
220
211
echo " Added astra init snippet to $astra_bashrc "
221
212
fi
@@ -234,7 +225,7 @@ echo -e "\n\n\nAll done!\n\n"
234
225
echo " "
235
226
echo " Please open a new terminal, or run the following in the existing one:"
236
227
echo " "
237
- echo " source \" ${ASTRA_DIR} /bin /astra-init.sh\" "
228
+ echo " source \" ${ASTRA_CLI_DIR} /astra-init.sh\" "
238
229
echo " "
239
230
echo " Then issue the following command:"
240
231
echo " "
0 commit comments