Skip to content
Open
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
2 changes: 1 addition & 1 deletion test-scripts/sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh

set -e
dir="$(cd "$(dirname "$_")" && pwd)"
dir="$(cd "$(dirname "$0")" && pwd)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a good fix. For improved robustness, it's good practice to use -- with dirname to signal the end of options. This prevents dirname from misinterpreting the script path as an option if $0 were to ever begin with a hyphen (-). While this is an unlikely edge case for a script name, it's a good defensive programming habit. I've noticed other scripts in test-scripts/ don't use this; it might be worth considering applying this pattern consistently for better robustness.

dir="$(cd "$(dirname -- "$0")" && pwd)"

script="${dir}/../dist/ColorEcho.sh"
. "${script}"

Expand Down