File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,22 @@ get_script_dir() {
2525 cd " $( dirname " ${target} " ) " 2> /dev/null && pwd
2626 fi
2727}
28- # --- 5. Compute APP_DIR ---
28+
29+ detect_platform () {
30+ OS=" $( uname -s) "
31+ case " $OS " in
32+ Linux* )
33+ if [ -f /etc/wsl.conf ] || grep -qi microsoft /proc/version 2> /dev/null; then
34+ printf ' windows'
35+ else
36+ printf ' linux'
37+ fi ;;
38+ Darwin* ) printf ' macos' ;;
39+ CYGWIN* |MINGW* |MSYS* ) printf ' windows' ;;
40+ * ) printf ' unsupported' ;;
41+ esac
42+ }
43+
2944compute_app_dir () {
3045 case " $PLATFORM " in
3146 linux)
6984SCRIPT_DIR=" $( get_script_dir " ${SCRIPT_PATH} " ) "
7085
7186# Allow overrides for advanced/testing/dev
87+
88+ PLATFORM=" $( detect_platform) "
7289APP_DIR=" $( compute_app_dir) "
7390printf ' Using giv app directory: %s\n' " ${APP_DIR} "
7491LIB_DIR=" "
You can’t perform that action at this time.
0 commit comments