-
Notifications
You must be signed in to change notification settings - Fork 58
Add extensions support for vscode-web #154
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
Conversation
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}" | ||
for extension in "$${EXTENSIONLIST[@]}"; do | ||
if [ -z "$extension" ]; then | ||
continue | ||
fi | ||
printf "🧩 Installing extension $${CODE}$extension$${RESET}...\n" | ||
output=$($VSCODE_SERVER --install-extension "$extension" --force) | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to install extension: $extension: $output" | ||
exit 1 | ||
fi |
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.
Given:
EXTENSIONS="foo,bar,baz"
I would suggest the following posix way, so we don't need to rely on bash/arrays.
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}" | |
for extension in "$${EXTENSIONLIST[@]}"; do | |
if [ -z "$extension" ]; then | |
continue | |
fi | |
printf "🧩 Installing extension $${CODE}$extension$${RESET}...\n" | |
output=$($VSCODE_SERVER --install-extension "$extension" --force) | |
if [ $? -ne 0 ]; then | |
echo "Failed to install extension: $extension: $output" | |
exit 1 | |
fi | |
extension= | |
while [ "$${extension}" != "$${EXTENSIONS}" ]; do | |
extension=$${EXTENSIONS%%,*} | |
EXTENSIONS=$${EXTENSIONS#*,} | |
if [ -z "$${extension}" ]; then | |
continue | |
fi | |
printf "🧩 Installing extension $${CODE}$extension$${RESET}...\n" | |
output=$("$${VSCODE_SERVER}" --install-extension "$${extension}" --force) | |
if [ $? -ne 0 ]; then | |
echo "Failed to install extension: $${extension}: $${output}" | |
exit 1 | |
fi |
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.
This section is borrowed from code-server
, and I did not try to improve it as code-server is our top downloaded module and well tested. But I agree and we can update.
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.
@mafredri, any second thoughts? Otherwise I should also update code-server module.
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@mafredri I removed the tests as our modification to run commands was causing many other tests to fail. |
This pull request adds support for installing extensions in vscode-web.
closes #153
fix testsmerging without tests for now.How to test