[gen_image] Now accepts the TARGET_DIR parameter
This commit is contained in:
parent
762c49da89
commit
d77ee127c8
1 changed files with 3 additions and 2 deletions
|
@ -6,13 +6,14 @@
|
||||||
# gen_image - Generates image from list of lossless audio files
|
# gen_image - Generates image from list of lossless audio files
|
||||||
#
|
#
|
||||||
# USAGE
|
# USAGE
|
||||||
# gen_image <file_1> [<file_1>] [<...>]
|
# gen_image </path/to/output/dir> <file_1> [<file_1>] [<...>]
|
||||||
#
|
#
|
||||||
# DEPENDENCIES src/med_convert
|
# DEPENDENCIES src/med_convert
|
||||||
#
|
#
|
||||||
# }
|
# }
|
||||||
|
|
||||||
gen_image() {
|
gen_image() {
|
||||||
|
local TARGET_DIR="${1}"; shift
|
||||||
local fileList=("${@}")
|
local fileList=("${@}")
|
||||||
if [[ ${#fileList[@]} -eq 1 ]]; then
|
if [[ ${#fileList[@]} -eq 1 ]]; then
|
||||||
cat ${fileList[@]} > joined.flac
|
cat ${fileList[@]} > joined.flac
|
||||||
|
@ -24,7 +25,7 @@ gen_image() {
|
||||||
echo ${fileList[@]}
|
echo ${fileList[@]}
|
||||||
fileList=($(printf '%s\n' ${fileList[@]} | sed 's|flac|wav|'))
|
fileList=($(printf '%s\n' ${fileList[@]} | sed 's|flac|wav|'))
|
||||||
echo ${fileList[@]}
|
echo ${fileList[@]}
|
||||||
shntool join -O always ${fileList[@]} -o flac
|
shntool join -O always ${fileList[@]} -d "${TARGET_DIR}" -o flac
|
||||||
[[ $? -ne 0 ]] && return 1
|
[[ $? -ne 0 ]] && return 1
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue