From 22ba41cd971f9de95f4242f8fea960d2085cddf8 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Thu, 12 Sep 2019 10:10:24 +0100 Subject: Pass args to scripts --- rc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'rc') diff --git a/rc b/rc index 5334d94..86e2f27 100644 --- a/rc +++ b/rc @@ -8,12 +8,17 @@ function cd { VERBOSE=--verbose fi + ARGS= + for arg in $* ; do + ARGS="${ARGS} --arg ${arg}" + done + if [ "x$1" == "x" -o "x$1" == "x-" -o -d "$1" ]; then # Outgoing stuff - [ -d "$HOME/.cdhooks/outgoing/pre-local" ] && run-parts $VERBOSE $HOME/.cdhooks/outgoing/pre-local - [ -d ".cdhooks/outgoing" ] && run-parts $VERBOSE .cdhooks/outgoing - [ -d "$HOME/.cdhooks/outgoing/post-local" ] && run-parts $VERBOSE $HOME/.cdhooks/outgoing/post-local + [ -d "$HOME/.cdhooks/outgoing/pre-local" ] && run-parts $VERBOSE $ARGS $HOME/.cdhooks/outgoing/pre-local + [ -d ".cdhooks/outgoing" ] && run-parts $VERBOSE $ARGS .cdhooks/outgoing + [ -d "$HOME/.cdhooks/outgoing/post-local" ] && run-parts $VERBOSE $ARGS $HOME/.cdhooks/outgoing/post-local # cd if [ "x" == "x$*" ] @@ -24,9 +29,9 @@ function cd { fi # Incoming stuff - [ -d "$HOME/.cdhooks/incoming/pre-local" ] && run-parts $VERBOSE $HOME/.cdhooks/incoming/pre-local - [ -d ".cdhooks/incoming" ] && run-parts $VERBOSE .cdhooks/incoming - [ -d "$HOME/.cdhooks/incoming/post-local" ] && run-parts $VERBOSE $HOME/.cdhooks/incoming/post-local + [ -d "$HOME/.cdhooks/incoming/pre-local" ] && run-parts $VERBOSE $ARGS $HOME/.cdhooks/incoming/pre-local + [ -d ".cdhooks/incoming" ] && run-parts $VERBOSE $ARGS .cdhooks/incoming + [ -d "$HOME/.cdhooks/incoming/post-local" ] && run-parts $VERBOSE $ARGS $HOME/.cdhooks/incoming/post-local else -- cgit v1.2.1