Add relative symlink test

This commit is contained in:
Ethan P 2020-01-21 09:58:26 -08:00
parent c74d47ecd0
commit e0b9819859
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,16 @@
set -e
# Create symlink.
templink="$(basename "$0" ".sh")._temp"
tempabs="$(pwd)/${templink}"
ln -s "../../src/batgrep.sh" "$templink"
chmod +x "$templink"
# Run symlink.
export PATH="$(pwd):$PATH"
cd /tmp
"$(basename "$templink")" "templink" "${BASH_SOURCE[0]}" -C 0 | sed '1d;$d' || true
# Cleanup.
rm "$tempabs"

View File

@ -0,0 +1,5 @@
templink="$(basename "$0" ".sh")._temp"
tempabs="$(pwd)/${templink}"
ln -s "../../src/batgrep.sh" "$templink"
chmod +x "$templink"
"$(basename "$templink")" "templink" "${BASH_SOURCE[0]}" -C 0 | sed '1d;$d' || true