File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 2424 - name : Test code-server
2525 run : yarn test:standalone-release code-server
2626
27+ alpine :
28+ name : Test installer on Alpine
29+ runs-on : ubuntu-latest
30+ container : " alpine:3.14"
31+ steps :
32+ - name : Checkout repo
33+ uses : actions/checkout@v2
34+
35+ - name : Install curl
36+ run : apk add curl
37+
38+ - name : Add user
39+ run : adduser coder --disabled-password
40+
41+ # Standalone should work without root.
42+ - name : Test standalone to a non-existent prefix
43+ run : su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
44+
2745 macos :
2846 name : Test installer on macOS
2947 runs-on : macos-latest
Original file line number Diff line number Diff line change @@ -132,7 +132,6 @@ main() {
132132 unset \
133133 DRY_RUN \
134134 METHOD \
135- STANDALONE_INSTALL_PREFIX \
136135 OPTIONAL \
137136 ALL_FLAGS \
138137 RSH_ARGS \
@@ -381,6 +380,10 @@ install_standalone() {
381380 fetch " https://github.com/cdr/code-server/releases/download/v$VERSION /code-server-$VERSION -$OS -$ARCH .tar.gz" \
382381 " $CACHE_DIR /code-server-$VERSION -$OS -$ARCH .tar.gz"
383382
383+ # -w only works if the directory exists so try creating it first. If this
384+ # fails we can ignore the error as the -w check will then swap us to sudo.
385+ sh_c mkdir -p " $STANDALONE_INSTALL_PREFIX " 2> /dev/null || true
386+
384387 sh_c=" sh_c"
385388 if [ ! -w " $STANDALONE_INSTALL_PREFIX " ]; then
386389 sh_c=" sudo_sh_c"
You can’t perform that action at this time.
0 commit comments