From 77d0dcd32c01c5fa6d53efbe59145a2d08197fea Mon Sep 17 00:00:00 2001 From: Roxedus Date: Wed, 29 Dec 2021 21:31:35 +0100 Subject: [PATCH] Add helper for mods --- README.md | 1 + readme-vars.yml | 1 + root/usr/local/bin/install-extension | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 root/usr/local/bin/install-extension diff --git a/README.md b/README.md index 2f766b2..459f88d 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **29.12.21:** - Add `install-extension` as a helper for mods to install extensions. * **10.12.21:** - Update deprecated connectionToken arg. * **30.11.21:** - Fix app folder permissions, add the optional sudo password vars. * **29.11.21:** - Create `.profile` and `.bashrc` for the user. diff --git a/readme-vars.yml b/readme-vars.yml index bbf3d09..fdcdf7d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -61,6 +61,7 @@ app_setup_block: | # changelog changelogs: + - { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." } - { date: "10.12.21:", desc: "Update deprecated connectionToken arg." } - { date: "30.11.21:", desc: "Fix app folder permissions, add the optional sudo password vars." } - { date: "29.11.21:", desc: "Create `.profile` and `.bashrc` for the user." } diff --git a/root/usr/local/bin/install-extension b/root/usr/local/bin/install-extension new file mode 100644 index 0000000..60115c3 --- /dev/null +++ b/root/usr/local/bin/install-extension @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +_install=(/app/openvscode-server/server.sh "--extensions-dir" "/config/.vscode-remote/extensions" "--install-extension") + +if [ "$(whoami)" == "abc" ]; then + "${_install[@]}" "$@" +else + s6-setuidgid abc "${_install[@]}" "$@" +fi