all repos — dotfiles-base @ 51e366dd6001a49634fbf384abd7bba8b800d747

base important configs that can safely be used almost anywhere

Add misc. useful functions from bash
x1phosura x1phosura@x1phosura.zone
Fri, 11 Oct 2024 01:27:09 -0700
commit

51e366dd6001a49634fbf384abd7bba8b800d747

parent

03882a3f6b43542b45f5b8edfbf37809a1a467d0

2 files changed, 24 insertions(+), 0 deletions(-)

jump to
A .config/fish/functions/sync-src-to-dest.fish

@@ -0,0 +1,11 @@

+function sync-src-to-dest --description 'Creates an executable shell script boilerplate file' + if test (count $argv) -ne 2 + echo "A useful rsync helper, semi-unsafe if used thoughtlessly" + echo "usage: sync-src-to-dest [src-dir/] [dest-dir/]" + return 1 + end + + # for syncing to Android phone + #rsync -rlgo -vhcz -e ssh --stats --progress --delete --force $argv[1] $argv[2] + rsync -avhcz -e ssh --stats --progress --delete --force $argv[1] $argv[2] +end
A .config/fish/functions/touch-script.fish

@@ -0,0 +1,13 @@

+function touch-script --description 'Creates an executable shell script boilerplate file' + if test (count $argv) -eq 0 + echo "usage: $argv[0] [path(s) to one or more script file(s) to init...]" + return 1 + end + + for file in $argv + printf \ + "#!/bin/sh\n\n# script body here...\n" > $file \ + > $file + chmod +x $file + end +end