From 552ddc60804e9cc6850f76099033af81927da911 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 23 Sep 2021 07:15:19 -0700 Subject: [PATCH] flesh out some compatibility stuff i forgot --- sh/aur | 9 ++++++--- sh/confirm | 1 + sh/countdiff | 3 +++ sh/ff | 1 + sh/wipe | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sh/aur b/sh/aur index 32b51f1..7580182 100755 --- a/sh/aur +++ b/sh/aur @@ -1,8 +1,9 @@ #!/usr/bin/env bash # http://aur.sh with massive feature creep -# YES_ZSH - -# TODO: check compatibility with bash and dash. +# NO_ZSH +# YES_BASH +# NO_DASH +# NO_ASH aur() { ### @- ### download, edit, make, and install packages from the @@ -136,4 +137,6 @@ aur() { ### @- [ "$fail" -eq 0 ] && return 0 || return 1 } +[ -n "${preload+-}" ] || . ~/sh/preload || exit 2 +eval ${preload:-preload} confirm [ -n "${preload+-}" ] || aur "$@" diff --git a/sh/confirm b/sh/confirm index 2a0916e..082ca6d 100755 --- a/sh/confirm +++ b/sh/confirm @@ -2,6 +2,7 @@ # YES_ZSH # YES_BASH # NO_DASH +# NO_ASH ### @ confirm ### display a simple yes-or-no prompt and return 0-or-1 respectively. diff --git a/sh/countdiff b/sh/countdiff index 405463d..428d88c 100755 --- a/sh/countdiff +++ b/sh/countdiff @@ -2,6 +2,9 @@ # YES_ZSH # YES_BASH # YES_DASH +# YES_ASH + +# works with busybox awk. countdiff() { ### @- ### count the number of lines changed between two files. diff --git a/sh/ff b/sh/ff index a641a15..ed18848 100755 --- a/sh/ff +++ b/sh/ff @@ -2,6 +2,7 @@ # YES_ZSH # YES_BASH # YES_DASH +# YES_ASH ff() { ### @- ### select a file from a given or current directory using diff --git a/sh/wipe b/sh/wipe index 2b6eb54..16231c1 100755 --- a/sh/wipe +++ b/sh/wipe @@ -4,6 +4,8 @@ # YES_DASH # YES_ASH +# works with busybox awk. + wipe() { ### @- ### clear the screen and its scrollback, then print a high-contrast horizontal line. ### using this, you'll know with absolute certainty that you're looking at the top of your history,