test/update-policy.sh: make the stub wget drop the execute bit
check / check (push) Successful in 11s
check / check (push) Successful in 11s
The stub wget copied each file with cp, which keeps the source's execute bit, so the "script not executable" assertion could not fail: removing the chmod 755 from script/update-policy left the tests green. Real wget writes a new file without the execute bit. The stub now writes with cat, as wget does, and the test fails without the chmod. Model: opus-5-5
This commit is contained in:
1 parent
47b35661a2
commit
29496c2586
1 file changed
+3
-2
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# test/update-policy.sh: test script/update-policy on throwaway repos. A
|
# test/update-policy.sh: test script/update-policy on throwaway repos. A
|
||||||
# stub wget serves the files from this checkout, or fails for the path
|
# stub wget serves the files from this checkout, or fails for the path
|
||||||
# in WGET_FAIL, so nothing touches the network.
|
# in WGET_FAIL, so nothing touches the network. Like wget, it writes a
|
||||||
|
# new file without the execute bit, whatever the source's mode.
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
PROMPTS="$(cd "$(dirname "$0")/.." && pwd -P)"
|
PROMPTS="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||||
@@ -25,7 +26,7 @@ while [ "\$#" -gt 1 ]; do
|
|||||||
done
|
done
|
||||||
path="\${1#https://git.eeqj.de/sneak/prompts/raw/branch/main/}"
|
path="\${1#https://git.eeqj.de/sneak/prompts/raw/branch/main/}"
|
||||||
[ "\$path" != "\${WGET_FAIL:-}" ] || exit 1
|
[ "\$path" != "\${WGET_FAIL:-}" ] || exit 1
|
||||||
cp "$PROMPTS/\$path" "\$output"
|
cat "$PROMPTS/\$path" > "\$output"
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$dir/bin/wget"
|
chmod +x "$dir/bin/wget"
|
||||||
PATH="$dir/bin:$PATH"
|
PATH="$dir/bin:$PATH"
|
||||||
|
|||||||
Reference in new issue
Block a user