From f86155febf796777f9879d0557a649bde8833d78 Mon Sep 17 00:00:00 2001 From: cirolosapio Date: Mon, 2 Oct 2023 16:11:50 +0200 Subject: [PATCH] update --- .../devcontainer-feature.json | 23 ++++++++++++++ src/alpine-n98-magerun/install.sh | 30 +++++++++++++++++++ src/alpine-nushell/install.sh | 1 - src/alpine-ohmyzsh/install.sh | 2 +- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/alpine-n98-magerun/devcontainer-feature.json create mode 100644 src/alpine-n98-magerun/install.sh diff --git a/src/alpine-n98-magerun/devcontainer-feature.json b/src/alpine-n98-magerun/devcontainer-feature.json new file mode 100644 index 0000000..39f60c5 --- /dev/null +++ b/src/alpine-n98-magerun/devcontainer-feature.json @@ -0,0 +1,23 @@ +{ + "name": "alpine-n98-magerun", + "id": "alpine-n98-magerun", + "version": "0.0.2", + "description": "Installs n98-magerun on alpine", + "documentationURL": "https://github.com/cirolosapio/devcontainers-features/tree/main/src/alpine-n98-magerun", + "options": { + "version": { + "type": "string", + "default": "7.1.0", + "description": "Version of n98-magerun to install", + "proposals": [ + "7.1.0", + "6.1.1" + ] + }, + "initStarship": { + "type": "boolean", + "default": true, + "description": "Init zsh" + } + } +} \ No newline at end of file diff --git a/src/alpine-n98-magerun/install.sh b/src/alpine-n98-magerun/install.sh new file mode 100644 index 0000000..b0c34ba --- /dev/null +++ b/src/alpine-n98-magerun/install.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +echo "Activating feature 'alpine-n98-magerun2'" + +VERSION="${VERSION:-7.1.0}" + +wget -q https://files.magerun.net/n98-magerun2-${VERSION}.phar -O /usr/local/bin/n98-magerun2.phar +# shasum -a256 n98-magerun2.phar +chmod +x /usr/local/bin/n98-magerun2.phar + +if [[ $INITZSH == "true" ]]; then + # ZSH PLUGIN + mkdir -p $_CONTAINER_USER_HOME/.oh-my-zsh/custom/plugins/n98-magerun2/ + wget -q https://raw.githubusercontent.com/netz98/n98-magerun2/develop/res/autocompletion/zsh/n98-magerun2.plugin.zsh -O $_CONTAINER_USER_HOME/.oh-my-zsh/custom/plugins/n98-magerun2/n98-magerun2.plugin.zsh + sed -i 's/^plugins=(/plugins=(\n n98-magerun2/g' $_CONTAINER_USER_HOME/.zshrc + + # ZSH ALIAS + echo $'alias m=bin/magento' >> $_CONTAINER_USER_HOME/.profile + echo $'alias n=n98-magerun2.phar' >> $_CONTAINER_USER_HOME/.profile + echo $'alias sup="m s:up"' >> $_CONTAINER_USER_HOME/.profile + echo $'alias sdc="m s:d:c"' >> $_CONTAINER_USER_HOME/.profile + echo $'alias cf="n c:f"' >> $_CONTAINER_USER_HOME/.profile + echo $'alias reindex="n i:rei"' >> $_CONTAINER_USER_HOME/.profile + echo $'alias refresh=my/shs/refresh.sh' >> $_CONTAINER_USER_HOME/.profile + echo $'alias catalog="n dev:urn-catalog:generate .vscode/catalog_tmp.xml"' >> $_CONTAINER_USER_HOME/.profile +fi + +echo 'Done!' \ No newline at end of file diff --git a/src/alpine-nushell/install.sh b/src/alpine-nushell/install.sh index 477e680..3506590 100644 --- a/src/alpine-nushell/install.sh +++ b/src/alpine-nushell/install.sh @@ -10,7 +10,6 @@ mkdir -p $_CONTAINER_USER_HOME/.config/nushell/ wget -q https://raw.githubusercontent.com/nushell/nushell/main/crates/nu-utils/src/sample_config/default_config.nu -O $_CONTAINER_USER_HOME/.config/nushell/config.nu wget -q https://raw.githubusercontent.com/nushell/nushell/main/crates/nu-utils/src/sample_config/default_env.nu -O $_CONTAINER_USER_HOME/.config/nushell/env.nu - if [[ $INITSTARSHIP == "true" ]]; then echo $'\nmkdir ~/.cache/starship\nstarship init nu | save -f ~/.cache/starship/init.nu' >> $_CONTAINER_USER_HOME/.config/nushell/env.nu echo $'\nsource ~/.cache/starship/init.nu' >> $_CONTAINER_USER_HOME/.config/nushell/config.nu diff --git a/src/alpine-ohmyzsh/install.sh b/src/alpine-ohmyzsh/install.sh index 9fb1d9c..8cf074c 100644 --- a/src/alpine-ohmyzsh/install.sh +++ b/src/alpine-ohmyzsh/install.sh @@ -10,7 +10,7 @@ curl -s https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.s git clone https://github.com/supercrabtree/k $_CONTAINER_USER_HOME/.oh-my-zsh/custom/plugins/k git clone https://github.com/zsh-users/zsh-autosuggestions $_CONTAINER_USER_HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting $_CONTAINER_USER_HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting -sed -i 's/plugins=(git)/plugins=(git sudo k zsh-autosuggestions zsh-syntax-highlighting)/' $_CONTAINER_USER_HOME/.zshrc +sed -i 's/plugins=(git)/plugins=(\n git\n sudo\n k\n zsh-autosuggestions\n zsh-syntax-highlighting\n)/' $_CONTAINER_USER_HOME/.zshrc if [[ $INITSTARSHIP == "true" ]]; then echo $'\neval "$(starship init zsh)"' >> $_CONTAINER_USER_HOME/.zshrc