Skip to content

Commit 19f03b6

Browse files
committed
fix install script color escapes and show chad init in getting started
1 parent 0f2066b commit 19f03b6

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

install.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ INSTALL_DIR="$HOME/.chadscript"
66
VERSION="0.1.0"
77

88
if [ -t 1 ]; then
9-
BOLD='\033[1m'
10-
DIM='\033[2m'
11-
GREEN='\033[32m'
12-
CYAN='\033[36m'
13-
YELLOW='\033[33m'
14-
RED='\033[31m'
15-
RESET='\033[0m'
9+
ESC=$(printf '\033')
10+
BOLD="${ESC}[1m"
11+
DIM="${ESC}[2m"
12+
GREEN="${ESC}[32m"
13+
CYAN="${ESC}[36m"
14+
YELLOW="${ESC}[33m"
15+
RED="${ESC}[31m"
16+
RESET="${ESC}[0m"
1617
else
1718
BOLD='' DIM='' GREEN='' CYAN='' YELLOW='' RED='' RESET=''
1819
fi
1920

20-
info() { printf "${CYAN}info${RESET} %s\n" "$1"; }
21-
success() { printf "${GREEN}${RESET} %s\n" "$1"; }
22-
warn() { printf "${YELLOW}warn${RESET} %s\n" "$1"; }
23-
err() { printf "${RED}error${RESET} %s\n" "$1" >&2; exit 1; }
21+
info() { printf "%s\n" "${CYAN}info${RESET} $1"; }
22+
success() { printf "%s\n" "${GREEN}${RESET} $1"; }
23+
warn() { printf "%s\n" "${YELLOW}warn${RESET} $1"; }
24+
err() { printf "%s\n" "${RED}error${RESET} $1" >&2; exit 1; }
2425

2526
detect_libc() {
2627
if [ "$(uname -s)" != "Linux" ]; then
@@ -135,7 +136,9 @@ WRAPPER
135136
printf "\n"
136137
printf " Then try:\n"
137138
printf "\n"
138-
printf " ${CYAN}chad run examples/hello.ts${RESET}\n"
139+
printf " ${CYAN}mkdir myproject && cd myproject${RESET}\n"
140+
printf " ${CYAN}chad init${RESET}\n"
141+
printf " ${CYAN}chad run hello.ts${RESET}\n"
139142
printf "\n"
140143
}
141144

0 commit comments

Comments
 (0)