Skip to content

Commit d717512

Browse files
committed
Change test setup scripts to use relative folder
1 parent 0d78ca5 commit d717512

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test/helpers/setup_tmux_conf.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
# Tests helper script for setting up `.tmux.conf` within the VM.
44
# To be used by sourcing from within individual test scripts.
5+
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
56

67
setup_tmux_conf() {
78
# Copy mode (vi or emacs) is automatically determined from EDITOR
89
# environment variable set in test runner file `test/run-tests-within-vm`.
910
if tmux_is_at_least 2.4; then
1011
echo "bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel" > ~/.tmux.conf
1112
echo "bind-key -T copy-mode y send-keys -X copy-selection-and-cancel" >> ~/.tmux.conf
12-
echo "run-shell '/vagrant/copycat.tmux'" >> ~/.tmux.conf
13+
echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf
1314
else
1415
echo "bind-key -t vi-copy y copy-selection" > ~/.tmux.conf
1516
echo "bind-key -t emacs-copy y copy-selection" >> ~/.tmux.conf
16-
echo "run-shell '/vagrant/copycat.tmux'" >> ~/.tmux.conf
17+
echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf
1718
fi
1819
}
1920

test/helpers/setup_tmux_conf_with_custom_searches.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
# Tests helper script for setting up `.tmux.conf` within the VM.
44
# To be used by sourcing from within individual test scripts.
55

6+
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
7+
68
setup_tmux_conf() {
79
# Copy mode (vi or emacs) is automatically determined from EDITOR
810
# environment variable set in test runner file `test/run-tests-within-vm`.
911
if tmux_is_at_least 2.4; then
1012
echo "bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel" > ~/.tmux.conf
1113
echo "bind-key -T copy-mode y send-keys -X copy-selection-and-cancel" >> ~/.tmux.conf
1214
echo "set -g @copycat_search_C-t 'random string[[:digit:]]+'" >> ~/.tmux.conf
13-
echo "run-shell '/vagrant/copycat.tmux'" >> ~/.tmux.conf
15+
echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf
1416
else
1517
echo "bind-key -t vi-copy y copy-selection" > ~/.tmux.conf
1618
echo "bind-key -t emacs-copy y copy-selection" >> ~/.tmux.conf
1719
echo "set -g @copycat_search_C-t 'random string[[:digit:]]+'" >> ~/.tmux.conf
18-
echo "run-shell '/vagrant/copycat.tmux'" >> ~/.tmux.conf
20+
echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf
1921
fi
2022
}
2123
# Cache the TMUX version for speed.

0 commit comments

Comments
 (0)