Commit 27ff756cd1b4e607d0bd4efdcfe39155605904db
1 parent
5d199ab209
Remove the `.zcompdump` file only if it exists.
Showing 1 changed file with 1 additions and 1 deletions Inline Diff
tests/.zshenv
1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. | 1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. |
2 | 2 | ||
3 | # See cram's documentation for some of the variables used below. | 3 | # See cram's documentation for some of the variables used below. |
4 | 4 | ||
5 | export ADOTDIR="$PWD/dot-antigen" | 5 | export ADOTDIR="$PWD/dot-antigen" |
6 | 6 | ||
7 | rm "$TESTDIR/.zcompdump" | 7 | test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump" |
8 | 8 | ||
9 | source "$TESTDIR/../antigen.zsh" | 9 | source "$TESTDIR/../antigen.zsh" |
10 | 10 | ||
11 | # A test plugin repository to test out antigen with. | 11 | # A test plugin repository to test out antigen with. |
12 | 12 | ||
13 | export PLUGIN_DIR="$PWD/test-plugin" | 13 | export PLUGIN_DIR="$PWD/test-plugin" |
14 | mkdir "$PLUGIN_DIR" | 14 | mkdir "$PLUGIN_DIR" |
15 | 15 | ||
16 | # A wrapper function over `git` to work with the test plugin repo. | 16 | # A wrapper function over `git` to work with the test plugin repo. |
17 | alias pg='git --git-dir "$PLUGIN_DIR/.git" --work-tree "$PLUGIN_DIR"' | 17 | alias pg='git --git-dir "$PLUGIN_DIR/.git" --work-tree "$PLUGIN_DIR"' |
18 | 18 | ||
19 | echo 'alias hehe="echo hehe"' > "$PLUGIN_DIR"/aliases.zsh | 19 | echo 'alias hehe="echo hehe"' > "$PLUGIN_DIR"/aliases.zsh |
20 | 20 | ||
21 | { | 21 | { |
22 | pg init | 22 | pg init |
23 | pg add . | 23 | pg add . |
24 | pg commit -m 'Initial commit' | 24 | pg commit -m 'Initial commit' |
25 | } > /dev/null | 25 | } > /dev/null |
26 | 26 | ||
27 | # Another test plugin. | 27 | # Another test plugin. |
28 | 28 | ||
29 | export PLUGIN_DIR2="$PWD/test-plugin2" | 29 | export PLUGIN_DIR2="$PWD/test-plugin2" |
30 | mkdir "$PLUGIN_DIR2" | 30 | mkdir "$PLUGIN_DIR2" |
31 | 31 | ||
32 | # A wrapper function over `git` to work with the test plugin repo. | 32 | # A wrapper function over `git` to work with the test plugin repo. |
33 | alias pg2='git --git-dir "$PLUGIN_DIR2/.git" --work-tree "$PLUGIN_DIR2"' | 33 | alias pg2='git --git-dir "$PLUGIN_DIR2/.git" --work-tree "$PLUGIN_DIR2"' |
34 | 34 | ||
35 | echo 'alias hehe2="echo hehe2"' > "$PLUGIN_DIR2"/aliases.zsh | 35 | echo 'alias hehe2="echo hehe2"' > "$PLUGIN_DIR2"/aliases.zsh |
36 | 36 | ||
37 | { | 37 | { |
38 | pg2 init | 38 | pg2 init |
39 | pg2 add . | 39 | pg2 add . |
40 | pg2 commit -m 'Initial commit' | 40 | pg2 commit -m 'Initial commit' |
41 | } > /dev/null | 41 | } > /dev/null |
42 | 42 |