Add .local/bin/fishify-envs

Update .local/bin/localhost
Add .local/bin/push-chezmoi
This commit is contained in:
Lewis Wynne 2026-01-07 15:08:10 +00:00
parent ae921b2953
commit e08bb9229f
3 changed files with 43 additions and 8 deletions

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
in="$1"
if [[ -z "$in" ]]; then
echo "usage: $0 input_file"
exit 1
fi
while IFS= read -r line; do
[[ -z "$line" || "$line" =~ ^# ]] && continue
if [[ "$line" =~ ^([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
var="${BASH_REMATCH[1]}"
val="${BASH_REMATCH[2]}"
val="${val%\"}"
val="${val#\"}"
echo "set -Ux $var \"$val\""
fi
done < "$in"

View file

@ -1,13 +1,20 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail
IP=$(hostname -i | awk '{print $1}')
PORT=8000 PORT=8000
YELLOW=$(tput setaf 3) IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{print $7; exit}')
BLUE=$(tput setaf 4) IP=${IP:-127.0.0.1}
BOLD=$(tput bold)
RESET=$(tput sgr0)
echo "Serving ${YELLOW}${BOLD}$(pwd)${RESET} at ${BLUE}${BOLD}http://$IP:$PORT${RESET}" if [[ -t 1 ]]; then
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
BOLD=$(tput bold)
RESET=$(tput sgr0)
else
YELLOW= BLUE= BOLD= RESET=
fi
python3 -m http.server "$PORT" echo "Serving ${YELLOW}${BOLD}$(pwd)${RESET} at ${BLUE}${BOLD}http://${IP}:${PORT}${RESET}"
exec python3 -m http.server "$PORT"

View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
REPO="$(chezmoi source-path)"
cd "$REPO"
git push