X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=tools%2Fadd.sh;fp=_templates%2Fadd.sh;h=1d89a607192cc6801b4bd61a0af33b340d2a91f5;hb=84bd150c667e693c7ba6c31819b3f155f53e514a;hp=af6b2d8b3ad6b8abb461349de4184f18371c698f;hpb=4b94735961fc9474411a1ca200c3a00f744ec3f1;p=senf.git diff --git a/_templates/add.sh b/tools/add.sh similarity index 89% rename from _templates/add.sh rename to tools/add.sh index af6b2d8..1d89a60 100755 --- a/_templates/add.sh +++ b/tools/add.sh @@ -2,7 +2,9 @@ if [ -z "$1" ]; then cat <. [] +Usage: + $0 [-f] . [] + $0 [-f] SConscript [] Will add the file with that name to the current directory by copying the appropriate template and replacing the @NAME@ placeholders @@ -30,7 +32,7 @@ EOF exit 1 fi -base="`dirname "$0"`"; base="`cd "$base"; pwd`" +base="`dirname "$0"`"; base="`cd "$base/_templates"; pwd`" if [ "$1" == "-f" ]; then force=1 @@ -40,7 +42,7 @@ fi name="`basename "$1"`" case "$name" in *.*) type=".${name#*.}"; name="${name%.$type}" ;; - *) type="" ;; + *) type=".$name" ;; esac if [ ! -r "$base/Example$type" ] ; then