From 1d39a6f5bc74131ebfa6076eead0f92bc5daa7d9 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 15 Apr 2017 18:02:27 -0700 Subject: [PATCH] add unpublished gitslink script --- gitslink | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 gitslink diff --git a/gitslink b/gitslink new file mode 100755 index 0000000..3274c72 --- /dev/null +++ b/gitslink @@ -0,0 +1,40 @@ +#!/bin/bash + +source /a/bin/errhandle/errcatch-function +source /a/bin/errhandle/bash-trace-function +errcatch + +e() { echo "$*"; "$@"; } +lnf() { /a/bin/lnf/lnf "$@"; } + +shopt -s nullglob +shopt -s extglob + +cd /a/bin +# if we didn't have just automated files, we could cleanup +# links to not executable files. +e rm -rf /a/exe + +# sourcing instead of calling script changes runtime from .47s to .36s +source /a/bin/lnf/lnf >/dev/null ||: + +for x in !(unused|unfinished|queue|bash-template|buildscripts|crons|data|examples|log-quiet); do + [[ -e $x/.git ]] || continue + for y in $x/*; do + if [[ -x $y && ! -d $y ]]; then + lnf -v /a/bin/$y /a/exe + fi + done +done + +for x in *; do + if [[ ! -d $x && -x $x ]]; then + lnf -v /a/bin/$x /a/exe + fi +done + +# things we don't want to run in /a, because +# they are long running and could get in the way of +# btrfs remounting +/a/bin/distro-setup/install-my-scripts +/a/bin/log-quiet/setup -- 2.30.2