]> git.scottworley.com Git - picsort/commitdiff
Editing scripts to use them is lame
authorScott Worley <scottworley@scottworley.com>
Sun, 6 Apr 2014 05:12:08 +0000 (22:12 -0700)
committerScott Worley <scottworley@scottworley.com>
Sun, 6 Apr 2014 05:12:08 +0000 (22:12 -0700)
.gitignore
pic-mv

index fdde87f1226bb1f6aecd2ce25a5f25843f202348..b57bdec3f7be1848ae3d86438b1e7770dbc4bc07 100644 (file)
@@ -1,3 +1,4 @@
 ??
 *.jpeg
 *.NEF
 ??
 *.jpeg
 *.NEF
+.default-pic-mv-destdir
diff --git a/pic-mv b/pic-mv
index 92444da6b8cace709734c0c105d2a977c703c712..23da8c3746cf49f1f98444c418a1c8ef4c0e1506 100755 (executable)
--- a/pic-mv
+++ b/pic-mv
@@ -1,6 +1,9 @@
 #!/bin/bash
 
 #!/bin/bash
 
-destdir=/some/path  # Optional: Fill this in here.
+destdir=
+if [[ -e .default-pic-mv-destdir ]];then
+  destdir=$( < .default-pic-mv-destdir )
+fi
 
 exposure=
 rotate=
 
 exposure=
 rotate=
@@ -13,6 +16,11 @@ while getopts d:e:r: opt;do
 done
 shift `expr $OPTIND - 1`
 
 done
 shift `expr $OPTIND - 1`
 
+if [[ -z "$destdir" ]];then
+  echo "Please specify a destdir with -d or .default-pic-mv-destdir" >&2
+  exit 1
+fi
+
 file="$1"
 name="$2"
 
 file="$1"
 name="$2"