-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: Remove Alpine GitHub Copilot CLI feature"
This reverts commit 5b1491c.
- Loading branch information
1 parent
7019184
commit b2534f0
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
# alpine-gh-copilot-cli (alpine-gh-copilot-cli) | ||
|
||
Installs Github Copilot CLI on alpine | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"ghcr.io/cirolosapio/devcontainers-features/alpine-gh-copilot-cli:0": {} | ||
} | ||
``` | ||
|
||
|
||
|
||
## Customizations | ||
|
||
### VS Code Extensions | ||
|
||
- `GitHub.copilot-chat` | ||
- `GitHub.copilot` | ||
|
||
|
||
|
||
--- | ||
|
||
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/cirolosapio/devcontainers-features/blob/main/src/alpine-gh-copilot-cli/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "alpine-gh-copilot-cli", | ||
"id": "alpine-gh-copilot-cli", | ||
"version": "0.0.14", | ||
"description": "Installs Github Copilot CLI on alpine", | ||
"documentationURL": "https://github.com/cirolosapio/devcontainers-features/tree/main/src/alpine-gh-copilot-cli", | ||
"installsAfter": [ | ||
"ghcr.io/cirolosapio/devcontainers-features/alpine-user", | ||
"ghcr.io/cirolosapio/devcontainers-features/alpine-bash", | ||
"ghcr.io/cirolosapio/devcontainers-features/alpine-ohmyzsh" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"GitHub.copilot-chat", | ||
"GitHub.copilot" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
echo "Activating feature 'alpine-gh-copilot-cli'" | ||
|
||
apk --no-cache add npm | ||
npm i -g @githubnext/github-copilot-cli | ||
|
||
if command -v zsh &> /dev/null || command -v bash &> /dev/null; then | ||
if command -v zsh &> /dev/null; then | ||
RC_PROFILE=".zshrc" | ||
else | ||
RC_PROFILE=".bashrc" | ||
fi | ||
|
||
CURRENT_USER=$(getent passwd 1000 | cut -d: -f1) | ||
|
||
if [ -z "$_CONTAINER_USER_HOME" ]; then | ||
if [ -z "$CURRENT_USER" ]; then | ||
_CONTAINER_USER_HOME=/root | ||
else | ||
_CONTAINER_USER_HOME=$(getent passwd $CURRENT_USER | cut -d: -f6) | ||
fi | ||
fi | ||
|
||
if [[ -z $CURRENT_USER ]]; then | ||
echo 'eval "$(github-copilot-cli alias -- "$0")"' >> $_CONTAINER_USER_HOME/$RC_PROFILE | ||
else | ||
CMD="echo 'eval \"\$(github-copilot-cli alias -- \"\$0\")\"' >> \$_CONTAINER_USER_HOME/$RC_PROFILE" | ||
su -c "$CMD" $CURRENT_USER | ||
fi | ||
fi | ||
|
||
echo 'Done!' |