diff --git a/src/cmd_import b/src/cmd_import index 0fdd7ed..0d43344 100644 --- a/src/cmd_import +++ b/src/cmd_import @@ -28,8 +28,5 @@ cmd_import() { local GIT_DIR="${2}"; shift 2 local dirList=(${@}) - - [[ "${CMD}" == "cueripper" ]] && import_cueripper ${@} - [[ "${CMD}" == "eac" ]] && import_eac ${@} - [[ "${CMD}" == "tracks" ]] && import_tracks ${@} + eval import_${CMD} "${GIT_DIR}" ${@} } diff --git a/src/cmd_import_cueripper b/src/cmd_import_cueripper index 3b31d2c..fafaf0a 100644 --- a/src/cmd_import_cueripper +++ b/src/cmd_import_cueripper @@ -11,12 +11,13 @@ # } cmd_import_cueripper() { + local GIT_DIR="${1}"; shift local dirList=("${@}") for dir in ${dirList[@]}; do folderList=($(find "${dir}" -name '*.cue' -printf '%h\n' | awk '!seen[$0]++')) for folder in ${folderList[@]}; do - gen "${folder}" + import_cueripper "${GIT_DIR}" "${folder}" done done } diff --git a/src/cmd_import_tracks b/src/cmd_import_tracks index d7efa3b..1737f28 100644 --- a/src/cmd_import_tracks +++ b/src/cmd_import_tracks @@ -10,13 +10,13 @@ # # } -cmd_import_tracks { +cmd_import_tracks() { local ROOT="${1}"; shift 1 local dirList=("${@}") for dir in ${dirList[@]}; do folderList=($(find ${ROOT}/${dir} -name '*cover*' -printf '%h\n' | awk '!seen[$0]++' | sed "s|${ROOT}/||g")) for folder in ${folderList[@]}; do - gen ${ROOT} "${folder}" + import_tracks ${ROOT} "${folder}" done done }