File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1212
1313jobs :
1414 ubuntu :
15- name : Test installer on ubuntu
15+ name : Test installer on Ubuntu
1616 runs-on : ubuntu-latest
1717 steps :
1818 - name : Checkout repo
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 Node.js v14
36+ uses : actions/setup-node@v2
37+ with :
38+ node-version : " 14"
39+
40+ - name : Install curl
41+ run : apk add curl
42+
43+ - name : Add user
44+ run : adduser coder --disabled-password
45+
46+ # Standalone should work without root.
47+ - name : Test standalone to a non-existent prefix
48+ run : su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
49+
2750 macos :
2851 name : Test installer on macOS
2952 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