Skip to content

Commit

Permalink
scripts: fix shellcheck error and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Synar committed Nov 8, 2024
1 parent c9daa1d commit 798cd09
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/check-commit-titles.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
# shellcheck disable=SC2317

# This script reads newline separated commit titles from stdin
# output an error message when titles are deemed invalid,
# and exits accordingly

if [ -z "$NOCOLOR" ]; then
RED=$(tput setaf 1 2>/dev/null)
YELLOW=$(tput setaf 3 2>/dev/null)
BLUE=$(tput setaf 4 2>/dev/null)
RESET=$(tput sgr0 2>/dev/null)
fi
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ jobs:

- name: Find and check all scripts using ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore_names: gradlew

check_generated_railjson_sync:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion editoast/assets/signal_sprites/generate-atlas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ for signaling_system in $(ls); do
cp "${tmp_dir}"/sprites/sprites* "${signaling_system}"

# Add a linefeed to the json files
for json_file in $(ls "${signaling_system}"/*.json); do
for json_file in "${signaling_system}"/*.json; do
[ -e "$json_file" ] || continue
echo "" >> "${json_file}"
done

Expand Down
4 changes: 2 additions & 2 deletions scripts/drop-core.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

docker rm -f dyn-osrd-core-$1
docker rm -f "dyn-osrd-core-$1"

docker compose \
-p "osrd" \
-f "docker-compose.yml" \
exec rabbitmq rabbitmqctl delete_queue core-$1
exec rabbitmq rabbitmqctl delete_queue "core-$1"
2 changes: 1 addition & 1 deletion scripts/load-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ "$#" -ne 1 ]; then
exit 1
fi

root_path="$(realpath $(dirname "$0")/..)"
root_path=$(realpath "$(dirname "$0")/..")

# Check sha1 is matching
echo "Checking backup integrity..."
Expand Down

0 comments on commit 798cd09

Please sign in to comment.