Skip to content

Commit

Permalink
refactor: get_ostree_data.sh use env shebang - remove from .sanity*
Browse files Browse the repository at this point in the history
Use the `#!/usr/bin/env bash` shebang which is ansible-test friendly.
This means we can remove get_ostree_data.sh from the .sanity* files.
This also means we can remove the .sanity* files if we do not need
them otherwise.

Rename `pth` to `path` in honor of nscott

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Dec 7, 2023
1 parent 2a9eb26 commit 25698e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .ostree/get_ostree_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ "$pkgtype" = testing ]; then
fi

get_rolepath() {
local ostree_dir role rolesdir roles_parent_dir coll_path pth
local ostree_dir role rolesdir roles_parent_dir coll_path path
ostree_dir="$1"
role="$2"
roles_parent_dir="$(dirname "$(dirname "$ostree_dir")")"
Expand All @@ -51,8 +51,8 @@ get_rolepath() {
coll_path="${ANSIBLE_COLLECTIONS_PATHS:-}"
fi
if [ -n "${coll_path}" ]; then
for pth in ${coll_path//:/ }; do
for rolesdir in "$pth"/ansible_collections/*/*_system_roles/roles/"$role"/.ostree; do
for path in ${coll_path//:/ }; do
for rolesdir in "$path"/ansible_collections/*/*_system_roles/roles/"$role"/.ostree; do
if [ -d "$rolesdir" ]; then
echo "$rolesdir"
return 0
Expand Down

0 comments on commit 25698e3

Please sign in to comment.