summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2009-08-19 14:56:12 +0200
committerdakkar <dakkar@thenautilus.net>2009-08-19 14:56:12 +0200
commit10a5c75e918840a9d94e296be2937416ea357d6e (patch)
tree71bc67301357982907916a0a85876dc56711ac8e
parenttranslations for labels (diff)
downloadthenautilus-10a5c75e918840a9d94e296be2937416ea357d6e.tar.gz
thenautilus-10a5c75e918840a9d94e296be2937416ea357d6e.tar.bz2
thenautilus-10a5c75e918840a9d94e296be2937416ea357d6e.zip
added "-f" option to force creation
-rwxr-xr-xnew-doc7
1 files changed, 6 insertions, 1 deletions
diff --git a/new-doc b/new-doc
index 23fdadb..b11ac79 100755
--- a/new-doc
+++ b/new-doc
@@ -21,12 +21,17 @@ shopt -s extglob
now="$(TZ=UTC date +'%F %T')"
+force=0
+if [[ "$1" == "-f" ]]; then
+ force=1
+ shift
+fi
docname="$1"
shift
declare -a tags
tags=("$@")
-if [[ -d "$docname" ]]; then
+if [[ -d "$docname" && "$force" -ne 1 ]]; then
>&2 echo "\"$docname\" already exists"
exit 1
fi