mirror of
https://github.com/lloeki/apply.git
synced 2025-12-06 09:24:38 +01:00
Locate units using APPLY_ROOT env var
This commit is contained in:
parent
8a178cdc2b
commit
44eeefea79
4 changed files with 21 additions and 5 deletions
10
run
10
run
|
|
@ -9,7 +9,11 @@ function usage() {
|
|||
}
|
||||
|
||||
function root_path() {
|
||||
cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd
|
||||
if [[ -z "${APPLY_ROOT:-}" ]]; then
|
||||
cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd
|
||||
else
|
||||
echo "$APPLY_ROOT"
|
||||
fi
|
||||
}
|
||||
|
||||
function read_group() {
|
||||
|
|
@ -19,7 +23,7 @@ function read_group() {
|
|||
if [[ ! "$item" == '#'* ]]; then
|
||||
echo "$item"
|
||||
fi
|
||||
done < "$(root_path)/$target"
|
||||
done < "$(root_path)/$target"
|
||||
}
|
||||
|
||||
function run_group() {
|
||||
|
|
@ -33,7 +37,7 @@ function run_group() {
|
|||
}
|
||||
|
||||
function run_unit() {
|
||||
/bin/bash -l -c "set -e; set -u; set -o pipefail; source lib; source '$*'"
|
||||
/bin/bash -l -c "set -e; set -u; set -o pipefail; source lib; source '$(root_path)/$*'"
|
||||
}
|
||||
|
||||
function log_file() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue