WSL + more modularity

This commit is contained in:
System administrator 2024-01-30 04:25:25 +00:00 committed by Bryan Ramos
parent 7b63b3b04f
commit e513913099
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
57 changed files with 356 additions and 92 deletions

View file

@ -0,0 +1,63 @@
''
export DIRENV_LOG_FORMAT=
function cdg() {
if [[ $1 == "--help" ]]; then
echo "A simple utility for navigating to the root of a git repo"
return 0
fi
# Check for invalid command
if [[ -n "$1" ]]; then
echo "Invalid command: $1. Try 'cdg --help'."
return 1
fi
local root_dir
root_dir=$(git rev-parse --show-toplevel 2>/dev/null)
local git_status=$?
if [ $git_status -ne 0 ]; then
echo "Error: Not a git repo."
return 1
fi
cd "$root_dir"
}
function penpot() {
case "$1" in
run)
sudo docker compose -p penpot -f ~/Documents/tools/penpot/docker-compose.yaml up -d >/dev/null 2>&1
nohup bash -c '(sleep 10 && if [[ "$OSTYPE" == "linux-gnu"* ]]; then
xdg-open "http://localhost:9001"
elif [[ "$OSTYPE" == "darwin"* ]]; then
open "http://localhost:9001"
fi)' >/dev/null 2>&1 &
echo "Started penpot on http://localhost:9001"
;;
stop)
echo "Stopping penpot"
sudo docker compose -p penpot -f ~/Documents/tools/penpot/docker-compose.yaml down >/dev/null 2>&1
;;
update)
sudo docker compose -f ~/Documents/tools/penpot/docker-compose.yaml pull
echo "Updated penpot!"
;;
help)
xdg-open "https://help.penpot.app/"
echo "Opened penpot help page in your browser."
;;
*)
echo "Usage: penpot {run|stop|update|help}"
;;
esac
}
source ~/Documents/projects/ldv/ldv.sh
set -o vi
bind 'set completion-ignore-case on'
bind 'set completion-map-case on'
''