Commit a8fcfb7a authored by Dmitri Popov's avatar Dmitri Popov

Bug fixes

parent b63cb2c6
......@@ -13,7 +13,7 @@ The [Linux Photography](https://gumroad.com/l/linux-photography) book provides d
momo.sh -d <dir> -g <location>
`-d` or `--directory` absolute path to the source directory
`-g` or `--geotag` name of the city where the photos were taken
`-g` or `--geotag` name of the city where the photos were taken (optional)
## Limitations
......
......@@ -89,6 +89,7 @@ if [ ! -f "$CONFIG" ]; then
fi
source "$CONFIG"
mkdir -p "$target"
echo
echo "---------------------"
......@@ -96,15 +97,14 @@ echo "Transferring files..."
echo "---------------------"
echo
results=$(find "$target" -type f -iname "*.JPG" -o -iname "*.ARW")
lines=$(echo -e $results | wc -l)
results=$(find "$src" -type f -iname "*.JPG" -o -iname "*.ARW")
lines=$(echo -e "$results" | wc -l)
for line in $(seq 1 $lines)
do
file=$(echo -e "$results" | sed -n "$line p")
echo "$file"
cp "$file" "$target"
done
cd "$target"
if [ ! -z "$location" ]; then
......@@ -129,6 +129,8 @@ fi
echo "Geotagging ..."
echo "--------------"
echo
results=$(find "$target" -type f -iname "*.JPG")
lines=$(echo -e "$results" | wc -l)
for line in $(seq 1 $lines)
do
file=$(echo -e "$results" | sed -n "$line p")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment