Skip to content

Commit 52eb632

Browse files
author
Fred
committed
chore: wip
1 parent 41dc6bc commit 52eb632

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

bootstrap

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ if [ -n "$1" ]; then
1212
exit 1
1313
else
1414
git clone https://github.com/stacksjs/stacks.git $1
15-
cd $1
15+
cd "$1" || exit 1
16+
1617
# Run the pkgx-install script
1718
"./storage/framework/scripts/pkgx-install"
1819

@@ -29,31 +30,37 @@ CLI_PATH="$PROJECT_ROOT/storage/framework/core/buddy/src/cli.ts"
2930
SCRIPT_PATH="$PROJECT_ROOT/storage/framework/scripts/pkgx-install"
3031
LOG_PATH="$PROJECT_ROOT/storage/logs/console.log"
3132

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
3842

39-
cd $PROJECT_ROOT
43+
cd "$PROJECT_ROOT" || exit 1
4044
# 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
4855

4956
# Create a named pipe
5057
mkfifo /tmp/mypipe
5158

5259
# 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 &
5461

5562
# 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"
5764

5865
# Remove the named pipe
5966
rm /tmp/mypipe

bun.lockb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)