@@ -116,17 +116,16 @@ check_apt_dependencies() {
116
116
fi
117
117
118
118
# Check if lib32gcc-s1 is installed (pwalk compilation requirement)
119
- if [[ $( dpkg -l lib32gcc-s1 > /dev/null 2>&1 ) ]]; then
120
- echo " Error: lib32gcc-s1 is not installed."
121
- echo
122
- echo " Please install lib32gcc-s1"
123
- echo " In most linux distros you can install the latest version of lib32gcc-s1 by running the following commands:"
124
- echo " sudo apt update"
125
- echo " sudo apt install -y lib32gcc-s1"
126
- echo
127
- exit 1
128
- fi
129
-
119
+ if [[ $( dpkg -l lib32gcc-s1 > /dev/null 2>&1 ) ]]; then
120
+ echo " Error: lib32gcc-s1 is not installed."
121
+ echo
122
+ echo " Please install lib32gcc-s1"
123
+ echo " In most linux distros you can install the latest version of lib32gcc-s1 by running the following commands:"
124
+ echo " sudo apt update"
125
+ echo " sudo apt install -y lib32gcc-s1"
126
+ echo
127
+ exit 1
128
+ fi
130
129
131
130
# Check if unzip is installed (rclone requirement)
132
131
if [[ -z $( command -v unzip) ]]; then
@@ -186,15 +185,15 @@ backup_old_installation() {
186
185
echo " Uninstalling existing froster installation..."
187
186
188
187
if pip list | grep froster > /dev/null 2>&1 ; then
189
- pip uninstall froster > /dev/null 2>&1 &
190
- spinner $!
188
+ pip uninstall froster > /dev/null 2>&1 &
189
+ spinner $!
191
190
fi
192
191
193
192
if pipx list | grep froster > /dev/null 2>&1 ; then
194
- # If froster is installed with pipx, uninstall it and ignore errors
195
- # sometime pipx uninstall fails with error code 1 if PIPX_HOME is set, but froster is still uninstalled
196
- pipx uninstall froster > /dev/null 2>&1 &
197
- spinner $!
193
+ # If froster is installed with pipx, uninstall it and ignore errors
194
+ # sometime pipx uninstall fails with error code 1 if PIPX_HOME is set, but froster is still uninstalled
195
+ pipx uninstall froster > /dev/null 2>&1 &
196
+ spinner $!
198
197
fi
199
198
200
199
echo " ...froster uninstalled"
@@ -229,7 +228,7 @@ install_froster() {
229
228
echo " Installing from the current directory"
230
229
pip install . > /dev/null 2>&1 &
231
230
spinner $!
232
- else
231
+ else
233
232
echo " Installing from PyPi package repository"
234
233
pipx install froster > /dev/null 2>&1 &
235
234
spinner $!
@@ -254,8 +253,6 @@ install_froster() {
254
253
fi
255
254
256
255
echo " ...froster installed"
257
-
258
- which froster
259
256
}
260
257
261
258
get_froster_dir () {
@@ -269,15 +266,21 @@ get_froster_dir() {
269
266
270
267
elif [ -f " ${PIPX_HOME} /venvs/froster/bin/froster" ]; then
271
268
froster_dir=$( dirname " $( readlink -f " ${PIPX_HOME} /venvs/froster/bin/froster" ) " )
272
-
269
+
273
270
elif [ -f " ${HOME} /.local/bin/froster" ]; then
274
271
froster_dir=$( dirname " $( readlink -f " ${HOME} /.local/bin/froster" ) " )
275
272
276
273
elif [ -f " /usr/local/bin/froster" ]; then
277
274
froster_dir=$( dirname " $( readlink -f " /usr/local/bin/froster" ) " )
278
275
else
279
- echo " Error: pipx installation path not found." >&2
280
- return 1
276
+ froster_path=$( which froster)
277
+
278
+ if [ -n " $froster_path " ]; then
279
+ froster_dir=$( dirname " $( readlink -f " $froster_path " ) " )
280
+ else
281
+ echo " Error: pipx installation path not found."
282
+ exit 1
283
+ fi
281
284
fi
282
285
283
286
echo " $froster_dir "
@@ -356,7 +359,6 @@ install_rclone() {
356
359
echo " Moving rclone to froster's binaries folder"
357
360
froster_dir=$( get_froster_dir)
358
361
mv rclone-v* /rclone ${froster_dir} /rclone > /dev/null 2>&1
359
-
360
362
361
363
# Remove the downloaded zip file
362
364
echo " Cleaning up rclone installation files"
0 commit comments