@@ -337,28 +337,42 @@ start_wgd_debug() {
337
337
}
338
338
339
339
update_wgd () {
340
- new_ver=$( $venv_python -c " import json; import urllib.request; data = urllib.request.urlopen('https://api.github.com/repos/donaldzou/WGDashboard/releases/latest').read(); output = json.loads(data);print(output['tag_name'])" )
341
- printf " %s\n" " $dashes "
342
- printf " [WGDashboard] Are you sure you want to update to the %s? (Y/N): " " $new_ver "
343
- read up
344
- if [ " $up " = " Y" ] || [ " $up " = " y" ]; then
345
- printf " [WGDashboard] Shutting down WGDashboard\n"
346
- if check_wgd_status; then
347
- stop_wgd
348
- fi
349
- mv wgd.sh wgd.sh.old
350
- printf " [WGDashboard] Downloading %s from GitHub..." " $new_ver "
351
- { date; git stash; git pull https://github.com/donaldzou/WGDashboard.git $new_ver --force; } >> ./log/update.txt
352
- chmod +x ./wgd.sh
353
- sudo ./wgd.sh install
354
- printf " [WGDashboard] Update completed!\n"
355
- printf " %s\n" " $dashes "
356
- rm wgd.sh.old
357
- else
358
- printf " %s\n" " $dashes "
359
- printf " | Update Canceled. |\n"
360
- printf " %s\n" " $dashes "
361
- fi
340
+
341
+ _determineOS
342
+ if ! python3 --version > /dev/null 2>&1
343
+ then
344
+ printf " [WGDashboard] Python is not installed, trying to install now\n"
345
+ _installPython
346
+ else
347
+ printf " [WGDashboard] %s Python is installed\n" " $heavy_checkmark "
348
+ fi
349
+
350
+ _checkPythonVersion
351
+ _installPythonVenv
352
+ _installPythonPip
353
+
354
+ new_ver=$( $venv_python -c " import json; import urllib.request; data = urllib.request.urlopen('https://api.github.com/repos/donaldzou/WGDashboard/releases/latest').read(); output = json.loads(data);print(output['tag_name'])" )
355
+ printf " %s\n" " $dashes "
356
+ printf " [WGDashboard] Are you sure you want to update to the %s? (Y/N): " " $new_ver "
357
+ read up
358
+ if [ " $up " = " Y" ] || [ " $up " = " y" ]; then
359
+ printf " [WGDashboard] Shutting down WGDashboard\n"
360
+ if check_wgd_status; then
361
+ stop_wgd
362
+ fi
363
+ mv wgd.sh wgd.sh.old
364
+ printf " [WGDashboard] Downloading %s from GitHub..." " $new_ver "
365
+ { date; git stash; git pull https://github.com/donaldzou/WGDashboard.git $new_ver --force; } >> ./log/update.txt
366
+ chmod +x ./wgd.sh
367
+ sudo ./wgd.sh install
368
+ printf " [WGDashboard] Update completed!\n"
369
+ printf " %s\n" " $dashes "
370
+ rm wgd.sh.old
371
+ else
372
+ printf " %s\n" " $dashes "
373
+ printf " [WGDashboard] Update Canceled.\n"
374
+ printf " %s\n" " $dashes "
375
+ fi
362
376
}
363
377
364
378
if [ " $# " != 1 ];
0 commit comments