mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-18 03:08:57 +01:00
Merge pull request #18 from thibaudcolas/patch-1
Make the script OSX compatible
This commit is contained in:
commit
9f57085905
@ -35,8 +35,8 @@ debug() {
|
|||||||
echo "$(date "+%F %T%z") ${1}"
|
echo "$(date "+%F %T%z") ${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'rm --recursive --force "${working_directory}"' EXIT
|
trap 'rm -r -f "${working_directory}"' EXIT
|
||||||
working_directory="$(mktemp --directory)"
|
working_directory=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'`
|
||||||
metadata_file="${working_directory}/metadata.txt"
|
metadata_file="${working_directory}/metadata.txt"
|
||||||
|
|
||||||
save_metadata() {
|
save_metadata() {
|
||||||
@ -48,7 +48,7 @@ save_metadata() {
|
|||||||
get_metadata_value() {
|
get_metadata_value() {
|
||||||
local key
|
local key
|
||||||
key="$1"
|
key="$1"
|
||||||
normalize_whitespace "$(grep --max-count=1 --only-matching "${key} *: .*" "$metadata_file" | cut --delimiter=: --fields=2 | sed -e 's#/##g;s/ (Unabridged)//' | tr -s '[:blank:]' ' ')"
|
normalize_whitespace "$(grep --max-count=1 --only-matching "${key} *: .*" "$metadata_file" | cut -d : -f 2 | sed -e 's#/##g;s/ (Unabridged)//' | tr -s '[:blank:]' ' ')"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_bitrate() {
|
get_bitrate() {
|
||||||
|
Loading…
Reference in New Issue
Block a user