mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-12 09:10:45 +01:00
Add relative symlink test
This commit is contained in:
parent
c74d47ecd0
commit
e0b9819859
16
test/tests/symlink.relative.sh
Normal file
16
test/tests/symlink.relative.sh
Normal 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"
|
||||
|
5
test/tests/symlink.relative.snapshot
Normal file
5
test/tests/symlink.relative.snapshot
Normal 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
|
Loading…
Reference in New Issue
Block a user