-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bash-my-aws: 2020-01-11 -> 2025-01-22 and refactor (#381934)
- Loading branch information
Showing
3 changed files
with
151 additions
and
45 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
pkgs/by-name/ba/bash-my-aws/0001-update-paths-to-placeholders.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/bin/bma b/bin/bma | ||
index 6144842..26965ce 100755 | ||
--- a/bin/bma | ||
+++ b/bin/bma | ||
@@ -13,7 +13,7 @@ | ||
# | ||
# Assumes you have installed bash-my-aws to standard location | ||
|
||
-for f in "${BMA_HOME:-$HOME/.bash-my-aws}"/lib/*-functions; do source $f; done | ||
+for f in @out@/lib/*-functions; do source $f; done | ||
|
||
# Disable awcli client side pager | ||
# | ||
diff --git a/scripts/build b/scripts/build | ||
index 54a786b..37a05df 100755 | ||
--- a/scripts/build | ||
+++ b/scripts/build | ||
@@ -41,7 +41,7 @@ funcs_after_bma=$(compgen -A function) | ||
exclusions=('region') | ||
|
||
for fnc in $(echo "${funcs_before_bma}" "${funcs_after_bma}" "${exclusions}" | tr ' ' '\n' | LC_ALL=C sort | uniq -u); do | ||
- echo "alias $fnc='\${BMA_HOME:-\$HOME/.bash-my-aws}/bin/bma $fnc'" >> "$aliases_destination" | ||
+ echo "alias $fnc='@out@/bin/bma $fnc'" >> "$aliases_destination" | ||
done; | ||
|
||
|
||
diff --git a/scripts/build-completions b/scripts/build-completions | ||
index 2b5d49b..bf86af6 100755 | ||
--- a/scripts/build-completions | ||
+++ b/scripts/build-completions | ||
@@ -6,7 +6,7 @@ cat <<EOF | ||
# DO NOT MANUALLY MODIFY THIS FILE. | ||
# Use 'scripts/build' to regenerate if required. | ||
|
||
-bma_path="\${BMA_HOME:-\$HOME/.bash-my-aws}" | ||
+bma_path="@out@" | ||
EOF | ||
|
||
# load in all the completions from scripts/completions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/test/stack-spec.sh b/test/stack-spec.sh | ||
index f04a10c..1165953 100755 | ||
--- a/test/stack-spec.sh | ||
+++ b/test/stack-spec.sh | ||
@@ -72,28 +72,30 @@ describe "_bma_stack_template_arg:" "$( | ||
|
||
)" | ||
|
||
-[[ -d cloudformation/params ]] || mkdir -p cloudformation/params | ||
+TEST_DIR=$(mktemp -d) | ||
+ | ||
+[[ -d "$TEST_DIR"/cloudformation/params ]] || mkdir -p "$TEST_DIR"/cloudformation/params | ||
|
||
|
||
# templates | ||
touch \ | ||
- $(dirname $0)/cloudformation/great-app.json \ | ||
- $(dirname $0)/cloudformation/great-app.yml \ | ||
- $(dirname $0)/cloudformation/great-app.yaml \ | ||
+ "$TEST_DIR"/cloudformation/great-app.json \ | ||
+ "$TEST_DIR"/cloudformation/great-app.yml \ | ||
+ "$TEST_DIR"/cloudformation/great-app.yaml \ | ||
|
||
# params | ||
|
||
[[ -d params ]] || mkdir params | ||
|
||
touch \ | ||
- $(dirname $0)/cloudformation/great-app-params.json \ | ||
- $(dirname $0)/cloudformation/great-app-params-staging.json \ | ||
- $(dirname $0)/cloudformation/great-app-params-another-env.json \ | ||
- $(dirname $0)/cloudformation/params/great-app-params.json \ | ||
- $(dirname $0)/cloudformation/params/great-app-params-staging.json \ | ||
- $(dirname $0)/cloudformation/params/great-app-params-another-env.json | ||
+ "$TEST_DIR"/cloudformation/great-app-params.json \ | ||
+ "$TEST_DIR"/cloudformation/great-app-params-staging.json \ | ||
+ "$TEST_DIR"/cloudformation/great-app-params-another-env.json \ | ||
+ "$TEST_DIR"/cloudformation/params/great-app-params.json \ | ||
+ "$TEST_DIR"/cloudformation/params/great-app-params-staging.json \ | ||
+ "$TEST_DIR"/cloudformation/params/great-app-params-another-env.json | ||
|
||
-cd $(dirname $0)/cloudformation | ||
+cd "$TEST_DIR"/cloudformation | ||
|
||
describe "_bma_stack_args:" "$( | ||
context "without an argument" "$( | ||
@@ -115,3 +117,5 @@ describe "_bma_stack_args:" "$( | ||
)" | ||
|
||
cd - | ||
+ | ||
+rm -rf "$TEST_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters