Reusable shell helpers
- Shell 93.9%
- Python 6.1%
This adds shell-safe documentation and helper wrappers for launching common tools, while extending existing developer utilities to work better in WSL by supporting Windows port cleanup, PowerShell transcript capture, and externally reachable vp dev servers. |
||
|---|---|---|
| allow-new.sh | ||
| catenv.sh | ||
| cda.sh | ||
| clank.sh | ||
| fjurl.sh | ||
| ghget.sh | ||
| gig.sh | ||
| git-qol.sh | ||
| git_worktree_orphan.sh | ||
| gotest.sh | ||
| image-namer-wrapper.sh | ||
| jjauthor.sh | ||
| jjdesc.sh | ||
| jjut.sh | ||
| mkcd.sh | ||
| notif.sh | ||
| pocock.sh | ||
| portkill.sh | ||
| pwsh_func.sh | ||
| pwshlog.sh | ||
| pwshlog_sanitize.py | ||
| README.md | ||
| runfunc | ||
| tcn.sh | ||
| tcnjjut.sh | ||
| tmsave.sh | ||
| tmux-later.sh | ||
| upload_patch.sh | ||
| uri.sh | ||
| vpdev.sh | ||
| wcd.sh | ||
| worktree-new.sh | ||
| worktree.sh | ||
~/scripts — sourced into EVERY login shell
Every *.sh here is sourced by ~/.bash_aliases into the login shell itself.
One file = one topic, defines a function named like the file (mkcd.sh → mkcd).
New command = drop NAME.sh defining function NAME. Done.
A mistake here breaks every new terminal, including plain wsl. Has happened.
Rules (MUST)
- Only DEFINE: functions, aliases, completions, env vars. Nothing runs at load time.
- Idempotent. Sourcing twice = harmless.
- Guard external tools:
command -v tool >/dev/null 2>&1 || return 0 return, neverexit.- NO
set -e|-u|-o pipefail|-x, noexit, noexec— these hit the login shell. - PATH not final at load time (
~/.local/bin,~/binnot appended yet). Use absolute paths if unavoidable.
set -euo pipefail = marker of an executable script → belongs in ~/bin, not here.
Run-once-per-login → ~/.profile (guarded). Periodic → cron/systemd timer.
Before adding a file
- No set -e/-u/pipefail/-x, no exit, no exec, nothing executes at load
bash --norc -c 'source ~/scripts/NEWFILE.sh; echo OK'wsl -e bash -l -c 'echo login OK'
The loader skips files containing set -e/exit/exec and sandboxes shell
options per file — safety net, not permission.
If startup broke
- Safe shell:
wsl -u <user> -e bash --noprofile --norc(orwsl -u root) - Trace:
env -i HOME=$HOME TERM=xterm PS4='+ ${BASH_SOURCE}:${LINENO}: ' bash -lixc true 2>/tmp/trace.log - Backup without shell:
wsl --export <distro> backup.tar