Skip to content

Commit

Permalink
Update AppRun
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuuzaki42 committed Jun 2, 2024
1 parent ab2889a commit a2e7b42
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ HERE="$(dirname "$(readlink -f "${0}")")"

count_Paramets=$#
echo -e "\ncount_Paramets: $count_Paramets"

all_Parameters=$@
echo -e "all_Parameters: $all_Parameters\n"

if [ $count_Paramets -lt 3 ]; then # If has less then 3 parameter, like --help
"$HERE"/opt/python3.*/bin/autosubsync "$all_Parameters"
else
#last_3_Paramets=$(echo "$all_parameters" | rev | cut -d ' ' -f1-3 | rev)
#echo -e "\nlast_3_Paramets: $last_3_Paramets"
#echo -e "last_3_Paramets: $last_3_Paramets\n"

others_Paramets=$(echo "$all_Parameters" | rev | cut -d ' ' -f4- | rev)
echo -e "\nothers_Paramets: $others_Paramets"
echo -e "others_Paramets: $others_Paramets\n"

# Add the current directory, $PWD, to the 3 last parameters
video_file=$PWD/${@: -3:1} # Third last parameter
subtitle_file=$PWD/${@: -2:1} # Second last parameter
output_file=$PWD/${@: -1:1} # Last parameter

echo -e " - Final Parameters -\nothers_Paramets: $others_Paramets\nvideo_file: $video_file"
echo -e "subtitle_file: $subtitle_file\noutput_file: $output_file\n"
echo -e " - Final Parameters -\nothers_Paramets: $others_Paramets\nvideo_file: $video_file"
echo -e "subtitle_file: $subtitle_file\noutput_file: $output_file\n"

if [ "$others_Paramets" == '' ]; then
"$HERE"/opt/python3.*/bin/autosubsync "$video_file" "$subtitle_file" "$output_file"
Expand Down

0 comments on commit a2e7b42

Please sign in to comment.