-
Notifications
You must be signed in to change notification settings - Fork 1
/
AppRun
executable file
·46 lines (36 loc) · 1.35 KB
/
AppRun
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
echo -e "\nRunning ffsubsync: $@"
HERE="$(dirname "$(readlink -f "${0}")")"
count_Paramets=$#
echo -e "\ncount_Paramets: $count_Paramets"
all_Parameters=$@
echo -e "all_Parameters: $all_Parameters\n"
prog_name=$1 # ffs, subsync or ffsubsync
if [ "$prog_name" == "" ]; then # Set ffs if none is passed
prog_name="ffs"
fi
# echo "$@"; # All parameters
shift # Remove the first arg from the "$@"
# echo "$@"; # All parameters except first one
if [ $count_Paramets -lt 5 ]; then # If has less then 5 parameters
echo " Examples of run:"
echo " ffs video.mp4 -i unsynchronized.srt -o synchronized.srt"
echo " ffsubsync reference.srt -i unsynchronized.srt -o synchronized.srt"
echo -e "\nRunning: $(ls $HERE/opt/python3.*/bin/$prog_name) $@"
"$HERE"/opt/python3.*/bin/"$prog_name" "$@"
else
# Add the current directory, $PWD, to the 3 parameters with files
sec_par="$PWD/$1" # second parameter
shift
thi_par="$1" # third parameter
shift
for_par="$PWD/$1" #fourth parameter
shift
fif_par="$1" # fifth parameter
shift
sex_par="$PWD/$1" # sixth parameter
shift
echo -e "\nRunning: $(ls $HERE/opt/python3.*/bin/$prog_name) $sec_par $thi_par $for_par $fif_par $sex_par $@\n"
"$HERE"/opt/python3.*/bin/"$prog_name" "$sec_par" "$thi_par" "$for_par" "$fif_par" "$sex_par" "$@"
fi
echo