Closed daniel-Jones closed 5 years ago
Thanks for reporting, I found the bug. It seems that whenever you put m:
in there it'd require an argument. I fixed it but I won't be able to push it till 20:00 +0900 JST because my campus network does not allow SSH.
9d1795e0936fac83021e78adfd31d57933f0e730 should fix this, give it a go.
Seems to be further broken
daniel_j@cirno[~/programming/bash/animegrep-1]$ ./animegrep.sh -f anime.mkv -w "French toast" -t 2
./animegrep.sh: line 34: [: too many arguments
You have both -d and -f set.. choose one, not both..
forgot auto-closure was a thing, but @daniel-Jones go ahead try using it now.
no, didn't help. still thinks both -d and -f are set and now lost the help output
@daniel-Jones I can't commit the patch right now but try this diff out to see if this changes anything
diff --git a/animegrep.sh b/animegrep.sh
index 5f31dda..f3bee83 100755
--- a/animegrep.sh
+++ b/animegrep.sh
@@ -46,22 +46,11 @@ shift $(($OPTIND -1))
set -- "{$POSITIONAL[@]}";
-# check for mkvextract
-command -v mkvextract >/dev/null 2>&1 || { echo >&2 "Requires mkvextract. Aborting."; exit 3; }
-# check for ffmpeg
-command -v ffmpeg >/dev/null 2>&1 || { echo >&2 "Requires ffmpeg. Aborting."; exit 3; }
-
# check if out directory exists
# TODO handle case out exists but other subdirs don't
if [ -z "$MERGE" ]; then
- if [ ! -d "out" ]; then
- echo "making out directory..";
- mkdir out;
- mkdir out/clips;
- fi
-
- if ! [ -z "$FILE" ] || [ -z "$DIRECTORY" ]; then
+ if [ ! -z "$FILE" ] && [ ! -z "$DIRECTORY" ]; then
echo "You have both -d and -f set.. choose one, not both..";
exit 127;
fi
@@ -94,6 +83,20 @@ if [ -z "$MERGE" ]; then
fi
# we're done the boring stuff
+
+# check for mkvextract
+command -v mkvextract >/dev/null 2>&1 || { echo >&2 "Requires mkvextract. Aborting."; exit 3; }
+# check for ffmpeg
+command -v ffmpeg >/dev/null 2>&1 || { echo >&2 "Requires ffmpeg. Aborting."; exit 3; }
+
+
+if [ ! -d "out" ]; then
+ echo "making out directory..";
+ mkdir out;
+ mkdir out/clips;
+fi
+
+
x=0;
should be fixed by 10cd1a3.
as originally intended, -m is to be used in a separate run after -d is used. -m shouldn't need a parameter.