commit b28f669a6d1b5e7f3f5bba4ad117211b36f521d5
parent c07512d533a30716d85fb10aed82929febc433bf
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Sat, 1 Sep 2018 22:50:03 +0200
Got rid of the annoying space before style/genre
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dotfiles/bin/itunes_style_getter b/dotfiles/bin/itunes_style_getter
@@ -44,7 +44,6 @@ while :; do
fi
# Remove brackets from the Ruby array
- echo $response
response=$(sed -e 's/^\[//' -e 's/\]$//' <<< "$response")
# Read the response into a bash array (genres, styles, url)
@@ -52,11 +51,13 @@ while :; do
# Create a bash array from the genres, stripping quotes
IFS='~' read -ra genre <<< "${response[0]//\"/}"; unset IFS
+ genre=$(sed -e 's/^ //' <<< $genre)
# Create a bash array from the styles, stripping quotes
# potential regex to surround each style in quotes: 's/\([^~]*\)/"\1"/g'
IFS='~' read -ra style <<< "${response[1]//\"/}"; unset IFS
+ style=$(sed -e 's/^ //' <<< $style)
# Save the url as a string, stripping quotes (and remove the brackets entered by Ruby)
url=$(sed -e 's/^ *\[//' -e 's/\]$//' <<<${response[2]//\"/})