From 50750fc366ee187311ff2dd93d21b336c2bd3183 Mon Sep 17 00:00:00 2001 From: Roxedus Date: Wed, 29 Dec 2021 23:01:42 +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 3268188..183001b 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. * **30.11.21:** - Fix app folder permissions, add the optional sudo password vars. * **29.11.21:** - Create `.profile` and `.bashrc` for the user. * **29.11.21:** - Release `insiders` tag. diff --git a/readme-vars.yml b/readme-vars.yml index af01a1e..ecc384a 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -62,6 +62,7 @@ app_setup_block: | # changelog changelogs: + - { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." } - { 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." } - { date: "29.11.21:", desc: "Release `insiders` tag." } diff --git a/root/usr/local/bin/install-extension b/root/usr/local/bin/install-extension new file mode 100644 index 0000000..c3d8b47 --- /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 \ No newline at end of file