diff options
Diffstat (limited to 'new-doc')
-rwxr-xr-x | new-doc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |