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

Allow spaces in extensions list #968

Open
wants to merge 2 commits into
base: code-server-extension-arguments
Choose a base branch
from

Conversation

rvenutolo
Copy link

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Currently, handling the VSCODE_EXTENSION_IDS environment variable does not allow for spaces in the string. This change strips all spaces from that variable before it is used to install extensions.

The VSCODE_EXTENSION_IDS handling will be more flexible to allow spaces and thus allow VSCODE_EXTENSION_IDS declarations like the following in Docker compose file:

VSCODE_EXTENSION_IDS: vscode-icons-team.vscode-icons | ms-azuretools.vscode-docker | ...

or nicer mult-line strings when one has numerous extensions.

VSCODE_EXTENSION_IDS: >
  | vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker
  | ...

Benefits of this PR and context:

This allows the user to include spaces in the VSCODE_EXTENSION_IDS value, which can improve readability in Docker compose files.

How Has This Been Tested?

I replaced the existing /etc/s6-overlay/s6-rc.d/init-mod-code-server-extension-arguments/run file with my updated version.

I ran docker compose up with each of the following VSCODE_EXTENSION_IDS definitions in the compose file. I then looked at the logging to check that the extension IDs were processed as desired.

VSCODE_EXTENSION_IDS: 'vscode-icons-team.vscode-icons|ms-azuretools.vscode-docker|redhat.vscode-yaml|redhat.java'
VSCODE_EXTENSION_IDS: ' |vscode-icons-team.vscode-icons| ms-azuretools.vscode-docker |  redhat.vscode-yaml  |  redhat.java    '
VSCODE_EXTENSION_IDS: >
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: >-
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: >+
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |-
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |+
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: '
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
  '
VSCODE_EXTENSION_IDS: "
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
  "

Source / References:

N/A

This a convenience to allows for spaces. Ex: `vscode-icons-team.vscode-icons | ms-azuretools.vscode-docker`.

Signed-off-by: Rick Venutolo <rvenutolo@users.noreply.github.com>
Signed-off-by: Rick Venutolo <rvenutolo@users.noreply.github.com>
@LinuxServer-CI
Copy link

PR build pushed to ghcr.io/linuxserver/mods:pull_request_968

@thespad thespad requested a review from aptalca October 24, 2024 18:57
@LinuxServer-CI
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: PRs Ready For Team Review
Development

Successfully merging this pull request may close these issues.

2 participants