@@ -12,7 +12,8 @@ if [ -n "$1" ]; then
12
12
exit 1
13
13
else
14
14
git clone https://github.com/stacksjs/stacks.git $1
15
- cd $1
15
+ cd " $1 " || exit 1
16
+
16
17
# Run the pkgx-install script
17
18
" ./storage/framework/scripts/pkgx-install"
18
19
@@ -29,31 +30,37 @@ CLI_PATH="$PROJECT_ROOT/storage/framework/core/buddy/src/cli.ts"
29
30
SCRIPT_PATH=" $PROJECT_ROOT /storage/framework/scripts/pkgx-install"
30
31
LOG_PATH=" $PROJECT_ROOT /storage/logs/console.log"
31
32
32
- if [[ $* == * --verbose* ]]; then
33
- echo " Project root: $PROJECT_ROOT "
34
- echo " CLI path: $CLI_PATH "
35
- echo " Script path: $SCRIPT_PATH "
36
- echo " Log path: $LOG_PATH "
37
- fi
33
+ case " $* " in
34
+ * --verbose* )
35
+ echo " Project root: $PROJECT_ROOT "
36
+ echo " CLI path: $CLI_PATH "
37
+ echo " Script path: $SCRIPT_PATH "
38
+ echo " Log path: $LOG_PATH "
39
+ ;;
40
+ * )
41
+ esac
38
42
39
- cd $PROJECT_ROOT
43
+ cd " $PROJECT_ROOT " || exit 1
40
44
# Run the pkgx-install script
41
- if [[ $* == * --verbose* ]]; then
42
- " $SCRIPT_PATH "
43
- # bun --bun ./storage/framework/core/buddy/src/cli.ts setup --verbose
44
- else
45
- " $SCRIPT_PATH " > /dev/null 2>&1
46
- # bun --bun ./storage/framework/core/buddy/src/cli.ts setup
47
- fi
45
+ case " $* " in
46
+ * --verbose* )
47
+ " $SCRIPT_PATH "
48
+ # bun --bun ./storage/framework/core/buddy/src/cli.ts setup --verbose
49
+ ;;
50
+ * )
51
+ " $SCRIPT_PATH " > /dev/null 2>&1
52
+ # bun --bun ./storage/framework/core/buddy/src/cli.ts setup
53
+ ;;
54
+ esac
48
55
49
56
# Create a named pipe
50
57
mkfifo /tmp/mypipe
51
58
52
59
# Run the command, send output to both the console and the pipe
53
- bun --bun $CLI_PATH setup | tee /tmp/mypipe &
60
+ bun --bun " $CLI_PATH " setup | tee /tmp/mypipe &
54
61
55
62
# Read from the pipe, add timestamps, and append to the file
56
- while IFS= read -r line; do echo " $( date ' +[%Y-%m-%d %H:%M:%S]' ) $line " ; done < /tmp/mypipe >> $LOG_PATH
63
+ while IFS= read -r line; do echo " $( date ' +[%Y-%m-%d %H:%M:%S]' ) $line " ; done < /tmp/mypipe >> " $LOG_PATH "
57
64
58
65
# Remove the named pipe
59
66
rm /tmp/mypipe
0 commit comments