Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cirolosapio committed Oct 2, 2023
1 parent abe1bb9 commit f86155f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/alpine-n98-magerun/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
30 changes: 30 additions & 0 deletions src/alpine-n98-magerun/install.sh
Original file line number Diff line number Diff line change
@@ -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!'
1 change: 0 additions & 1 deletion src/alpine-nushell/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/alpine-ohmyzsh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f86155f

Please sign in to comment.