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

@ -1,13 +1,20 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail
IP=$(hostname -i | awk '{print $1}')
PORT=8000
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
BOLD=$(tput bold)
RESET=$(tput sgr0)
IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{print $7; exit}')
IP=${IP:-127.0.0.1}
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"