diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb575d97..909694a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - name: Build (${{ github.ref_name}}) if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/canary' }} run: | - export TAG=amd64 + export TAG=canary-amd64 export VCS_REF=$(git rev-parse HEAD) npm install -g @devcontainers/cli devcontainer build --workspace-folder . --config devcontainer.json --image-name cs50/codespace:${{ github.sha }} --image-name cs50/codespace:${{ github.ref_name }} diff --git a/Dockerfile b/Dockerfile index b7bbc499..0fe6e35f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,6 +98,13 @@ RUN npm install --global @vscode/vsce yarn && \ mv design50-1.0.0.vsix /opt/cs50/extensions && \ cd /tmp && \ rm --force --recursive design50.vsix && \ + git clone https://github.com/cs50/help50.vsix.git && \ + cd help50.vsix && \ + npm install && \ + vsce package && \ + mv help50-0.0.1.vsix /opt/cs50/extensions && \ + cd /tmp && \ + rm --force --recursive help50.vsix && \ npm uninstall --global vsce yarn diff --git a/devcontainer.json b/devcontainer.json index 96404779..1d58982a 100644 --- a/devcontainer.json +++ b/devcontainer.json @@ -14,6 +14,7 @@ "/opt/cs50/extensions/cs50-0.0.1.vsix", "/opt/cs50/extensions/design50-1.0.0.vsix", "/opt/cs50/extensions/ddb50-2.0.0.vsix", + "/opt/cs50/extensions/help50-0.0.1.vsix", "/opt/cs50/extensions/phpliteadmin-0.0.1.vsix", "/opt/cs50/extensions/style50-0.0.1.vsix", "cs50.extension-uninstaller", @@ -168,7 +169,11 @@ "terminal.integrated.defaultProfile.linux": "bash", "terminal.integrated.gpuAcceleration": "off", "terminal.integrated.profiles.linux": { - "JavaScript Debug Terminal": null + "JavaScript Debug Terminal": null, + "Sysadmins": { + "args": ["bash"], + "path": "sudo" + } }, "terminal.integrated.persistentSessionReviveProcess": "never", "terminal.integrated.sendKeybindingsToShell": true, diff --git a/etc/profile.d/codespace.sh b/etc/profile.d/codespace.sh index 2e767fad..e7122938 100644 --- a/etc/profile.d/codespace.sh +++ b/etc/profile.d/codespace.sh @@ -1,5 +1,8 @@ # If not root -if [ "$(whoami)" != "root" ]; then +if [ `id -u` -ne 0 ]; then + + # Library + . /opt/cs50/lib/cli # Check if running locally and set $RepositoryName if not already set if [[ "$CODESPACES" != "true" && -z "$RepositoryName" ]]; then @@ -82,4 +85,17 @@ if [ "$(whoami)" != "root" ]; then http-server() { command http-server "$@" | _hostname | _version | uniq } + + # Helpers + function _helped() { + : # TODO: invoke command that hides help50 button + } + function _helpful() { + $ _alert "$(_ansi "🦆 Click \`help50\` for help")" # Temporary, to introduce new feature + : # TODO: invoke command that sends $1 to ddb50 as though from duck itself + } + function _helpless() { + $ _alert "$(_ansi "🦆 Click \`help50\` for help")" # Temporary, to introduce new feature + : # TODO: invoke command that sends $1 to ddb50 as though from student + } fi