Skip to content

Commit 9768b13

Browse files
authored
chore: fix init.sh output message
1 parent b802be6 commit 9768b13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

initialize.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ while [ $# -gt 0 ]; do
2121
-*)
2222
echo "Unknown option: $1"
2323
echo "Usage: $0 [--template static|server] [project-name]"
24-
exit 1
24+
1
2525
;;
2626
*)
27-
PROJECT_NAME="web-ui-template"
27+
PROJECT_NAME="$1"
2828
;;
2929
esac
3030
shift
@@ -48,7 +48,7 @@ fi
4848
cp -R "$TEMPLATE_PATH" "$PROJECT_NAME"
4949

5050
# macOS/BSD sed needs '' after -i, GNU sed does not
51-
if [ $(uname -s)" = "Darwin" ] then
51+
if [ "$(uname -s)" = "Darwin" ]; then
5252
SED_INPLACE="sed -i ''"
5353
else
5454
SED_INPLACE="sed -i"
@@ -59,4 +59,5 @@ find "$PROJECT_NAME/Sources" -type f -name "Application.swift" -exec $SED_INPLAC
5959
rm -rf "$PROJECT_NAME/.git"
6060
rm -rf "$TMP_DIR"
6161

62-
printf '\033[1;32m✓\033[0m \033[1;32m%s\033[0m initialisation complete\nRun \033[1;33mcd %s && swift run\033[0m to build\nyour static site to the \033[1;36m.output\033[0m directory.\n' "$PROJECT_NAME" "$PROJECT_NAME"
62+
# Simplified printf with proper ANSI codes
63+
printf '\033[1;32m✓ %s initialisation complete\nRun \033[1;33mcd %s && swift run\033[0m to build\nyour static site to the \033[1;36m.output\033[0m directory.\n' "$PROJECT_NAME" "$PROJECT_NAME"

0 commit comments

Comments
 (0)