Skip to content

Commit

Permalink
v3.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
escapace committed Mar 2, 2020
1 parent 7ce5765 commit 41087ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 33 deletions.
10 changes: 2 additions & 8 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else
exit 1
fi

MANAGE_VERSION="v3.5.4"
MANAGE_VERSION="v3.5.5"

MANAGE_IS_CI () {
# Returns 0 if the current environment
Expand Down Expand Up @@ -462,13 +462,7 @@ MANAGE_REPOSITORY_PATH () {
MANAGE_ERROR notRepository "${repository}"
}

modulePath="$(yq r "${directory}/.manage.yml" directories.module)"

if [[ "${modulePath}" == "null" ]]
then
modulePath="scripts/modules"
fi

modulePath="$(yq r "${directory}/.manage.yml" --defaultValue "scripts/modules" directories.module)"
modulePath="${directory}/${modulePath}"

[ ! -d "${modulePath}" ] && {
Expand Down
24 changes: 6 additions & 18 deletions modules/manage/parseYAML
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@
# shellcheck disable=SC2034

parseYAML () {
MANAGE_SCRIPT_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" directories.scripts || echo null)"
MANAGE_SCRIPT_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue scripts directories.scripts)"
MANAGE_SCRIPT_DIRECTORY="${MANAGE_REPOSITORY}/${MANAGE_SCRIPT_DIRECTORY}"

if [[ "${MANAGE_SCRIPT_DIRECTORY}" == "null" ]]
then
MANAGE_SCRIPT_DIRECTORY="${MANAGE_REPOSITORY}/scripts"
else
MANAGE_SCRIPT_DIRECTORY="${MANAGE_REPOSITORY}/${MANAGE_SCRIPT_DIRECTORY}"
fi

MANAGE_MODULE_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" directories.modules || echo null)"
MANAGE_MODULE_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null directories.modules)"

if [[ "${MANAGE_MODULE_DIRECTORY}" == "null" ]]
then
Expand All @@ -25,20 +19,14 @@ parseYAML () {
if [[ -z "${MANAGE_PUBLIC}" ]]
then
local public
public="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" enable | cut -c3- || echo ll)"
public="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue '- help' enable | cut -c3-)"

if [[ "${public}" == "ll" ]]
then
MANAGE_PUBLIC=("help")
else
# shellcheck disable=SC2206
MANAGE_PUBLIC=(${public})
fi
MANAGE_PUBLIC=(${public})
fi

if includes MANAGE_PUBLIC "test"
then
MANAGE_TEST_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" directories.tests || echo null)"
MANAGE_TEST_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null directories.tests)"

if [[ "${MANAGE_TEST_DIRECTORY}" == "null" ]]
then
Expand Down
13 changes: 6 additions & 7 deletions modules/manage/run
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ run () {
shift
executeScript "${name}" "$@"
else
name="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" default || echo null)"
name="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue help default)"

if [[ "${MANAGE_SCRIPT_DIRECTORY}" == "null" ]]
then
name="help"
fi
# if [[ "${MANAGE_SCRIPT_DIRECTORY}" == "null" ]]
# then
# name="help"
# fi

if scriptPresent "${name}"
then
Expand All @@ -66,11 +66,10 @@ scriptEnvironment ()
local delimiter=": "
local rx="s/^\([\"']\)\(.*\)\1\$/\2/g"

variables="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" env)"
variables="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null env)"

if [[ "${variables}" != "null" ]]
then

IFS=$'\n' read -rd '' -a lines <<< "${variables}"

for line in "${lines[@]}"
Expand Down

0 comments on commit 41087ad

Please sign in to comment.