Shortcuts für PlatformIO
This commit is contained in:
parent
ab2f2580a8
commit
370f5109b5
6 changed files with 77 additions and 0 deletions
12
oh-my-zsh/custom/example.zsh
Normal file
12
oh-my-zsh/custom/example.zsh
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Put files in this folder to add your own custom functionality.
|
||||||
|
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization
|
||||||
|
#
|
||||||
|
# Files in the custom/ directory will be:
|
||||||
|
# - loaded automatically by the init script, in alphabetical order
|
||||||
|
# - loaded last, after all built-ins in the lib/ directory, to override them
|
||||||
|
# - ignored by git by default
|
||||||
|
#
|
||||||
|
# Example: add custom/shortcuts.zsh for shortcuts to your local projects
|
||||||
|
#
|
||||||
|
# brainstormr=~/Projects/development/planetargon/brainstormr
|
||||||
|
# cd $brainstormr
|
||||||
54
oh-my-zsh/custom/platformio.zsh
Normal file
54
oh-my-zsh/custom/platformio.zsh
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
# PlatformIO Helper-Funktionen
|
||||||
|
# Findet das PlatformIO-Projektverzeichnis (wo platformio.ini liegt)
|
||||||
|
_pio_find_root() {
|
||||||
|
local dir="$PWD"
|
||||||
|
while [[ "$dir" != "/" ]]; do
|
||||||
|
if [[ -f "$dir/platformio.ini" ]]; then
|
||||||
|
echo "$dir"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
dir="$(dirname "$dir")"
|
||||||
|
done
|
||||||
|
echo "Fehler: Kein PlatformIO-Projekt gefunden (platformio.ini fehlt)" >&2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Build
|
||||||
|
alias piob='_pio_build'
|
||||||
|
_pio_build() {
|
||||||
|
local root=$(_pio_find_root) || return 1
|
||||||
|
echo "Building in: $root"
|
||||||
|
(cd "$root" && pio run)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Upload
|
||||||
|
alias piou='_pio_upload'
|
||||||
|
_pio_upload() {
|
||||||
|
local root=$(_pio_find_root) || return 1
|
||||||
|
echo "Uploading from: $root"
|
||||||
|
(cd "$root" && pio run --target upload)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Monitor
|
||||||
|
alias piom='_pio_monitor'
|
||||||
|
_pio_monitor() {
|
||||||
|
local root=$(_pio_find_root) || return 1
|
||||||
|
echo "Starting monitor from: $root"
|
||||||
|
(cd "$root" && pio device monitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Upload + Monitor (praktische Kombi)
|
||||||
|
alias pioum='_pio_upload_monitor'
|
||||||
|
_pio_upload_monitor() {
|
||||||
|
local root=$(_pio_find_root) || return 1
|
||||||
|
echo "Upload & Monitor from: $root"
|
||||||
|
(cd "$root" && pio run --target upload && pio device monitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clean
|
||||||
|
alias pioc='_pio_clean'
|
||||||
|
_pio_clean() {
|
||||||
|
local root=$(_pio_find_root) || return 1
|
||||||
|
echo "Cleaning: $root"
|
||||||
|
(cd "$root" && pio run --target clean)
|
||||||
|
}
|
||||||
3
oh-my-zsh/custom/plugins/example/example.plugin.zsh
Normal file
3
oh-my-zsh/custom/plugins/example/example.plugin.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
||||||
|
# here will override ones with the same name in the main plugins directory.
|
||||||
|
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins
|
||||||
1
oh-my-zsh/custom/plugins/zsh-syntax-highlighting
Submodule
1
oh-my-zsh/custom/plugins/zsh-syntax-highlighting
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 5eb677bb0fa9a3e60f0eff031dc13926e093df92
|
||||||
6
oh-my-zsh/custom/themes/example.zsh-theme
Normal file
6
oh-my-zsh/custom/themes/example.zsh-theme
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Put your custom themes in this folder.
|
||||||
|
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
|
||||||
|
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
|
||||||
1
oh-my-zsh/custom/themes/powerlevel10k
Submodule
1
oh-my-zsh/custom/themes/powerlevel10k
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 36f3045d69d1ba402db09d09eb12b42eebe0fa3b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue