delete original function no longer breaks when converting to different formats

This commit is contained in:
Nathaniel Landau
2016-01-07 12:52:51 -05:00
parent 512729c6e9
commit 779741dcdf

View File

@@ -22,6 +22,10 @@ scriptTemplateVersion="1.5.0" # Version of scriptTemplate.sh that this script is
# - Better renaming of existing files # - Better renaming of existing files
# #
# #
# TODO
# - fix delete file function
# - add overwrite original function
#
# ################################################## # ##################################################
# Provide a variable with the location of this script. # Provide a variable with the location of this script.
@@ -107,7 +111,7 @@ logFile="${HOME}/Library/Logs/${scriptBasename}.log"
# Homebrew Casks. Ruby and gems via RVM. # Homebrew Casks. Ruby and gems via RVM.
# ----------------------------------- # -----------------------------------
homebrewDependencies=(ffmpeg jq rename) homebrewDependencies=(ffmpeg jq rename)
caskDependencies=() caskDependencies=(xld)
gemDependencies=() gemDependencies=()
function mainScript() { function mainScript() {
@@ -625,17 +629,16 @@ function mainScript() {
} }
function deleteOriginalFile() { function deleteOriginalFile() {
local f
local newFile
if ${verbose}; then v="-v" ; fi if ${verbose}; then v="-v" ; fi
if [[ "${safeRun}" == "0" ]]; then if [[ "${safeRun}" == "0" ]]; then
if ${deleteOriginal}; then if ${deleteOriginal}; then
rm -f ${v} "${file}" rm -f ${v} "${file}"
if [[ "${file##*.}" == "${outputFormat}" ]]; then
mv ${v} "${output}" "${outputDir}${file}" mv ${v} "${output}" "${outputDir}${file}"
fi fi
fi fi
fi
} }
## RUN THE SCRIPT ## ## RUN THE SCRIPT ##