[gen_image] Can now define output file instead of output folder
This commit is contained in:
parent
4899def695
commit
8ecab1852f
1 changed files with 4 additions and 2 deletions
|
@ -6,14 +6,15 @@
|
||||||
# gen_image - Generates image from list of lossless audio files
|
# gen_image - Generates image from list of lossless audio files
|
||||||
#
|
#
|
||||||
# USAGE
|
# USAGE
|
||||||
# gen_image </path/to/output/dir> <file_1> [<file_1>] [<...>]
|
# gen_image </path/to/output/file> <file_1> [<file_2>] [<...>]
|
||||||
#
|
#
|
||||||
# DEPENDENCIES src/med_convert
|
# DEPENDENCIES src/med_convert
|
||||||
#
|
#
|
||||||
# }
|
# }
|
||||||
|
|
||||||
gen_image() {
|
gen_image() {
|
||||||
local TARGET_DIR="${1}"; shift
|
local TARGET="${1}"; shift
|
||||||
|
local TARGET_DIR=$(dirname "${TARGET}")
|
||||||
local fileList=("${@}")
|
local fileList=("${@}")
|
||||||
if [[ ${#fileList[@]} -eq 1 ]]; then
|
if [[ ${#fileList[@]} -eq 1 ]]; then
|
||||||
cat ${fileList[@]} > joined.flac
|
cat ${fileList[@]} > joined.flac
|
||||||
|
@ -31,6 +32,7 @@ gen_image() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
metaflac --remove-all --dont-use-padding "${TARGET_DIR}/joined.flac"
|
metaflac --remove-all --dont-use-padding "${TARGET_DIR}/joined.flac"
|
||||||
|
mv "${TARGET_DIR}/joined.flac" "${TARGET}"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue