Skip to content
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

Adds support for new help50 #160

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 6 additions & 1 deletion devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 17 additions & 1 deletion etc/profile.d/codespace.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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