Skip to content

Commit

Permalink
Upgrade YAML.SH and Follow curl redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
tk8817 authored Jul 2, 2019
1 parent 6fc8eea commit cf069aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ url_regex='^(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%
# shellcheck disable=SC2034
YSH_LIB=1;
# shellcheck disable=SC1091
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/azohra/yaml.sh/v0.1.4/ysh)"
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/azohra/yaml.sh/v0.2.0/ysh)"

pretty_print () {
local msg_type=${1}
Expand Down Expand Up @@ -45,7 +45,7 @@ run_command() {

parse_config() {
# Check for YML
if [[ "${yml_location}" =~ ${url_regex} ]]; then config=$(curl -s "${yml_location}" | ysh ); else config=$(ysh -f "${yml_location}"); fi
if [[ "${yml_location}" =~ ${url_regex} ]]; then config=$(curl -s -L "${yml_location}" | ysh ); else config=$(ysh -f "${yml_location}"); fi
if [ ! "${config}" ]; then pretty_print ":announce:" "Strapped::Config not found" && exit 2;else pretty_print ":announce:" "Config::${yml_location}"; fi
}

Expand Down

0 comments on commit cf069aa

Please sign in to comment.