Skip to content

Commit 77b4c1a

Browse files
committed
install.sh: Add echo_npm_postinstall
Updates #2349
1 parent fd79538 commit 77b4c1a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

install.sh

+13
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ echo_latest_version() {
7979
echo "$version"
8080
}
8181

82+
echo_npm_postinstall() {
83+
echoh
84+
cath << EOF
85+
The npm package has been installed successfully!
86+
Please extend your path to use code-server:
87+
PATH="$NPM_BIN_DIR:\$PATH"
88+
Please run with:
89+
code-server
90+
EOF
91+
}
92+
8293
echo_standalone_postinstall() {
8394
echoh
8495
cath << EOF
@@ -392,6 +403,7 @@ install_npm() {
392403
echoh "Installing with yarn."
393404
echoh
394405
"$sh_c" yarn global add code-server --unsafe-perm
406+
NPM_BIN_DIR="$(yarn global bin)" echo_npm_postinstall
395407
return
396408
elif command_exists npm; then
397409
sh_c="sh_c"
@@ -401,6 +413,7 @@ install_npm() {
401413
echoh "Installing with npm."
402414
echoh
403415
"$sh_c" npm install -g code-server --unsafe-perm
416+
NPM_BIN_DIR="$(npm bin -g)" echo_npm_postinstall
404417
return
405418
fi
406419
echoh

0 commit comments

Comments
 (0)