generated from me/template-mit
pv-test, fix committing final file, fix checking for finished versions, add welcome message.
This commit is contained in:
+7
-5
@@ -773,6 +773,8 @@ alias pa="v2a"
|
||||
|
||||
# Run all the different codecs, wrappers, bitrates, etc on a file.
|
||||
function pv-test {
|
||||
echo -e "Welcome! Let's get your tests set up...\n"
|
||||
|
||||
## Input ##
|
||||
|
||||
filename_in="$1"
|
||||
@@ -1003,11 +1005,11 @@ function pv-test {
|
||||
echo -e " * Parameters for this test: $newfile * \n"
|
||||
|
||||
if [[ -e "$newfile" ]]; then
|
||||
echo "Unfinished version of this file already exists, removing."
|
||||
rm -v "$newfile" ~/TRASH/
|
||||
mv -v "$newfile" ~/TRASH/
|
||||
echo -e "Removed unfinished version of this file.\n"
|
||||
fi
|
||||
if [[ -e *"$newfile" ]]; then
|
||||
echo "Completed version of this file already exists, skipping."
|
||||
if [[ `ls *"$newfile" 2>/dev/null` ]]; then
|
||||
echo -e "Completed version of this file already exists, skipping.\n"
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -1037,7 +1039,7 @@ function pv-test {
|
||||
printf -v padded_mins "%03d" "$minutes"
|
||||
printf -v padded_secs "%02d" "$seconds"
|
||||
|
||||
if [[ "$status" == 0 ]]; then
|
||||
if [[ "$status" == 0 && -s "$newfile" ]]; then
|
||||
mv -v "$newfile" "$(basename "${filename_in}_${padded_mins}m${padded_secs}s${newfile}")"
|
||||
else
|
||||
echo "ERROR: ffmpeg exited with status $status, not renaming file."
|
||||
|
||||
Reference in New Issue
Block a user