Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing shellcheck errors (looping on ls or glob) #85

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions ynh-dev
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function check_incus_setup()
if ! command -v incus &>/dev/null; then
critical "You need to have Incus installed for ynh-dev to be usable from the host machine. Refer to the README to know how to install it."
fi
if ! id -nG "$(whoami)" | grep -qw "incus-admin" && [ ! $(id -u) -eq 0 ]; then
if ! id -nG "$(whoami)" | grep -qw "incus-admin" && [ ! "$(id -u)" -eq 0 ]; then
critical "You need to be in the incus-admin group!"
fi

Expand Down Expand Up @@ -318,21 +318,22 @@ function use_git()
;;
yunohost)

for FILE in $(ls /ynh-dev/yunohost/bin/); do
create_sym_link "/ynh-dev/yunohost/bin/$FILE" "/usr/bin/$FILE"
done
while IFS= read -r -d '' FILE; do
create_sym_link "$FILE" "/usr/bin/${FILE##*/}"
done < <(find /ynh-dev/yunohost/bin/ -mindepth 1 -maxdepth 1 -print0)
mkdir -p "/usr/lib/metronome/modules"
while IFS= read -r -d '' FILE; do
create_sym_link "$FILE" "/usr/lib/metronome/modules/${FILE##*/}"
done < <(find /ynh-dev/yunohost/conf/metronome/modules/ -mindepth 1 -maxdepth 1 -print0)
while IFS= read -r -d '' FILE; do
create_sym_link "$FILE" "/usr/share/yunohost/${FILE##*/}"
done < <(find /ynh-dev/yunohost/share/ -mindepth 1 -maxdepth 1 -print0)

for FILE in $(ls /ynh-dev/yunohost/conf/metronome/modules/); do
create_sym_link "/ynh-dev/yunohost/conf/metronome/modules/$FILE" "/usr/lib/metronome/modules/$FILE"
done
for FILE in $(ls /ynh-dev/yunohost/share/); do
create_sym_link "/ynh-dev/yunohost/share/$FILE" "/usr/share/yunohost/$FILE"
done
create_sym_link "/ynh-dev/yunohost/hooks" "/usr/share/yunohost/hooks"
create_sym_link "/ynh-dev/yunohost/helpers/helpers" "/usr/share/yunohost/helpers"
for HELPER_DIR in $(ls -d /ynh-dev/yunohost/helpers/helpers*.d); do
create_sym_link "$HELPER_DIR" "/usr/share/yunohost/$(basename $HELPER_DIR)"
done
while IFS= read -r -d '' HELPER_DIR; do
create_sym_link "$HELPER_DIR" "/usr/share/yunohost/${HELPER_DIR##*/}"
done < <(find /ynh-dev/yunohost/helpers/ -mindepth 1 -maxdepth 1 -name "helpers*.d" -print0)
create_sym_link "/ynh-dev/yunohost/conf" "/usr/share/yunohost/conf"
create_sym_link "/ynh-dev/yunohost/locales" "/usr/share/yunohost/locales"
create_sym_link "/ynh-dev/yunohost/src" "/usr/lib/python3/dist-packages/yunohost"
Expand Down
Loading