From 07fa71141b85b83bd44d822c27202f2113c7520b Mon Sep 17 00:00:00 2001 From: Samuel Masuy Date: Sun, 27 Sep 2020 19:42:28 -0400 Subject: [PATCH] Rename variables --- spotify | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spotify b/spotify index 47a0ac5..febd502 100755 --- a/spotify +++ b/spotify @@ -26,13 +26,13 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -SHPOTIFY_CONFIG_DEFAULTS="CLIENT_ID=\"\"\nCLIENT_SECRET=\"\""; -SHPOTIFY_CONFIG_FILE=${SHPOTIFY_CONFIG_FILE:-${HOME}/.shpotify.cfg} -if ! [[ -f "${SHPOTIFY_CONFIG_FILE}" ]]; then - touch "${SHPOTIFY_CONFIG_FILE}"; - echo -e "${SHPOTIFY_CONFIG_DEFAULTS}" > "${SHPOTIFY_CONFIG_FILE}"; +USER_CONFIG_DEFAULTS="CLIENT_ID=\"\"\nCLIENT_SECRET=\"\""; +USER_CONFIG_FILE=${SHPOTIFY_CONFIG_FILE:-${HOME}/.shpotify.cfg} +if ! [[ -f "${USER_CONFIG_FILE}" ]]; then + touch "${USER_CONFIG_FILE}"; + echo -e "${USER_CONFIG_DEFAULTS}" > "${USER_CONFIG_FILE}"; fi -source "${SHPOTIFY_CONFIG_FILE}"; +source "${USER_CONFIG_FILE}"; # Set the percent change in volume for vol up and vol down VOL_INCREMENT=10 @@ -48,7 +48,7 @@ showAPIHelp() { echo " https://developer.spotify.com/my-applications/#!/applications/create"; echo; echo " Once you've created an application, find the 'Client ID' and 'Client Secret'"; - echo " values, and enter them into your shpotify config file at '${SHPOTIFY_CONFIG_FILE}'"; + echo " values, and enter them into your shpotify config file at '${USER_CONFIG_FILE}'"; echo; echo " Be sure to quote your values and don't add any extra spaces!"; echo " When done, it should look like this (but with your own values):"; @@ -170,12 +170,12 @@ while [ $# -gt 0 ]; do SPOTIFY_SEARCH_API="https://api.spotify.com/v1/search"; SPOTIFY_TOKEN_URI="https://accounts.spotify.com/api/token"; if [ -z "${CLIENT_ID}" ]; then - cecho "Invalid Client ID, please update ${SHPOTIFY_CONFIG_FILE}"; + cecho "Invalid Client ID, please update ${USER_CONFIG_FILE}"; showAPIHelp; exit 1; fi if [ -z "${CLIENT_SECRET}" ]; then - cecho "Invalid Client Secret, please update ${SHPOTIFY_CONFIG_FILE}"; + cecho "Invalid Client Secret, please update ${USER_CONFIG_FILE}"; showAPIHelp; exit 1; fi @@ -193,7 +193,7 @@ while [ $# -gt 0 ]; do -d "grant_type=client_credentials" \ ) if ! [[ "${SPOTIFY_TOKEN_RESPONSE_DATA}" =~ "access_token" ]]; then - cecho "Autorization failed, please check ${SHPOTIFY_CONFIG_FILE}" + cecho "Autorization failed, please check ${USER_CONFIG_FILE}" cecho "${SPOTIFY_TOKEN_RESPONSE_DATA}" showAPIHelp exit 1