-
Notifications
You must be signed in to change notification settings - Fork 1
feat: allow customizing workspace directory #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
1b861c5
fac790d
dbd1b6f
4c45deb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .PHONY: test | ||
| test: | ||
| devcontainer features test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ set -e | |
|
|
||
| CODE_SERVER_INSTALL_ARGS="" | ||
|
|
||
| if [ -n "$VERSION" ]; then | ||
| if [[ -n $VERSION ]]; then | ||
| CODE_SERVER_INSTALL_ARGS="$CODE_SERVER_INSTALL_ARGS --version=\"$VERSION\"" | ||
| fi | ||
|
|
||
|
|
@@ -17,12 +17,18 @@ do | |
| code-server --install-extension "$extension" | ||
| done | ||
|
|
||
| CODE_SERVER_WORKSPACE="$_REMOTE_USER_HOME" | ||
|
|
||
| if [[ -n $WORKSPACE ]]; then | ||
| CODE_SERVER_WORKSPACE="$WORKSPACE" | ||
| fi | ||
|
|
||
| cat > /usr/local/bin/code-server-entrypoint \ | ||
| << EOF | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| su $_REMOTE_USER -c 'code-server --bind-addr "$HOST:$PORT" \$ARGS' | ||
| su $_REMOTE_USER -c 'code-server --bind-addr "$HOST:$PORT" $ARGS "$CODE_SERVER_WORKSPACE"' | ||
|
||
| EOF | ||
|
|
||
| chmod +x /usr/local/bin/code-server-entrypoint | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Optional: Import test library bundled with the devcontainer CLI | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Feature-specific tests | ||
| check "code-server version" code-server --version | ||
| check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
| check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
|
||
| check "code-server workspace" grep $'\'code-server.*"/home"\'' < /usr/local/bin/code-server-entrypoint | ||
|
|
||
| # Report results | ||
| reportResults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$_REMOTE_USER_HOMEshould always be set