Bash: update magick wrapper
This commit is contained in:
parent
388b275bd0
commit
a8c315f5b4
1 changed files with 18 additions and 2 deletions
|
@ -298,13 +298,13 @@ function ta() {
|
|||
# Image magick ======================================================
|
||||
function magika() {
|
||||
if [[ "$1" == "a" || "$1" == "av1" ]]; then
|
||||
magick convert "$2" "${2%.*}.avif"
|
||||
magick "$2" "${2%.*}.avif"
|
||||
elif [[ "$1" == "i" ]]; then
|
||||
shift
|
||||
magick identify "$@"
|
||||
elif [[ "$1" == "c" ]]; then
|
||||
shift
|
||||
magick convert "$@"
|
||||
magick "$@"
|
||||
else
|
||||
magick "$@"
|
||||
fi
|
||||
|
@ -337,5 +337,21 @@ function truecolor () {
|
|||
source ~/.bash_prompt
|
||||
}
|
||||
|
||||
# Navigate to the project root ======================================
|
||||
rooter() {
|
||||
local current_dir="$PWD"
|
||||
|
||||
while [[ "$current_dir" != "/" ]]; do
|
||||
if [[ -d "$current_dir/.git" ]]; then
|
||||
cd "$current_dir"
|
||||
return 0
|
||||
else
|
||||
current_dir="$(dirname "$current_dir")"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No .git directory found above cwd." >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
# vim: set ft=bash ff=unix:
|
||||
|
|
Loading…
Reference in a new issue