This commit is contained in:
Timmo Schulte 2025-10-21 21:08:09 -03:00 committed by GitHub
commit ad4d87cb08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 73 additions and 0 deletions

25
plugins/spryker/README.md Normal file
View file

@ -0,0 +1,25 @@
# Spryker
This plugin provides aliases for the most frequently used [Spryker SDK](https://github.com/spryker-sdk) commands,
as well as code completion for the commands `console` and `boot`.
To use it add spryker to the plugins array in your zshrc file.
```bash
plugins=(... spryker)
```
## Aliases
| Alias | Command | Description |
|-----------|--------------------------------|-----------------------------------------------|
| `spk` | docker/sdk | Runs the Spryker SDK |
| `spkc` | spk console | Runs a Spryker console command |
| `spkb` | spk boot | Bootstrap spryker with a deploy file |
| `spkt` | spk testing | Starts a testing container |
| `spku` | spk up | Builds and runs Spryker applications |
| `spkup` | spk up --build --assets --data | Same as up + build, assets and data |
| `spkcli` | spk cli | Starts a terminal container |
| `spkcc` | spk clean && spk clean-data | Removes all images, volumes and storage |
| `spkl` | spk logs | Tails all application exception logs |
| `spkp` | spk prune | Remove all docker resources. Wipe everything. |

View file

@ -0,0 +1,48 @@
# Spryker SDK command completion
_spryker() {
echo "$(find . -maxdepth 2 -mindepth 1 -name 'sdk' -type f 2>/dev/null | head -n 1)"
}
_spryker_sdk () {
echo "$(_spryker)"
}
_spryker_sdk_boot () {
echo "$(_spryker) boot"
}
_spryker_sdk_console () {
echo "$(_spryker) console"
}
_spk_console () {
compadd $(`_spryker_sdk_console` --no-ansi 2>/dev/null | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }')
}
_spk_boot () {
compadd ls deploy.*.yml
}
_spk () {
compadd $(`_spryker_sdk` 2>/dev/null | sed "1,/Commands:/d" | awk '/^ ?[^ ]+ / { print $1 }')
}
compdef _spk_console '`_spryker_sdk_console`'
compdef _spk_console spkc
compdef _spk_boot '`_spryker_sdk_boot`'
compdef _spk_boot spkb
compdef _spk '`_spryker_sdk`'
compdef _spk spk
#Alias
alias spk='`_spryker_sdk`'
alias spkc='`_spryker_sdk_console`'
alias spkb='`_spryker_sdk_boot`'
alias spkt='spk testing'
alias spku='spk up'
alias spkup='spk up --build --assets --data'
alias spkcli='spk cli'
alias spkcc='spk clean && spk clean-data'
alias spkl='spk logs'
alias spkp='spk prune'