prefix output with ./ in example

This commit is contained in:
Joey Hess 2025-03-06 14:42:07 -04:00
parent b835c8c937
commit 825a648670
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -100,8 +100,11 @@ An example `git-annex-compute-foo` shell script follows:
echo "INPUT $2"
read input
echo "OUTPUT $3"
# Prefixing with ./ makes sure that the output is treated as a
# filename, rather than a dashed option.
output="./$3"
echo REPRODUCIBLE
if [ -n "$input" ]; then
mkdir -p "$(dirname "$3")"
frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$3"
mkdir -p "$(dirname "$output")"
frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$output"
fi