summaryrefslogtreecommitdiff
path: root/test/toru-path-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-09-30 00:27:23 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-10-01 17:35:22 -0400
commit4014f6c2cc579645aac56f51aa6063db7815c3a8 (patch)
tree549afea90ba2a0283c1507cd276a28d3e4fb243a /test/toru-path-test.sh
parent61e61226d8aeb2a973656a263cd0c523e9e55c88 (diff)
test: Clean up (config) file writing
Instead of using in inconsistent mish-mash of `mkdir` and `echo >` and `printf >>`, use more readable and identifiable indented-heredocs: install -Dm644 /dev/stdin "FILENAME" <<-eot CONTENTS eot
Diffstat (limited to 'test/toru-path-test.sh')
-rw-r--r--test/toru-path-test.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/toru-path-test.sh b/test/toru-path-test.sh
index 86571be..1feb341 100644
--- a/test/toru-path-test.sh
+++ b/test/toru-path-test.sh
@@ -12,9 +12,13 @@ it_displays_help() {
it_runs() {
mkdir -p "$XDG_CONFIG_HOME"/libretools
- printf 'TORUPATH=%q\n' "$tmpdir" >> "$XDG_CONFIG_HOME"/libretools/libretools.conf
- echo 'REPOS=(libre)' >> "$XDG_CONFIG_HOME"/libretools/libretools.conf
- printf 'ABSROOT=%q\n' "$PWD/toru.d" >> "$HOME"/.abs.conf
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ TORUPATH=${tmpdir@Q}
+ REPOS=(libre)
+ eot
+ cat >> "$HOME/.abs.conf" <<-eot
+ ABSROOT=${PWD@Q}/toru.d
+ eot
toru-path
@@ -39,9 +43,13 @@ it_runs() {
it_sets_torupath() {
mkdir -p "$XDG_CONFIG_HOME"/libretools
- printf 'TORUPATH=%q\n' "$tmpdir" >> "$XDG_CONFIG_HOME"/libretools/libretools.conf
- echo 'REPOS=(libre)' >> "$XDG_CONFIG_HOME"/libretools/libretools.conf
- printf 'ABSROOT=%q\n' "$PWD/toru.d" >> "$HOME"/.abs.conf
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ TORUPATH=${tmpdir@Q}
+ REPOS=(libre)
+ eot
+ cat >> "$HOME/.abs.conf" <<-eot
+ ABSROOT=${PWD@Q}/toru.d
+ eot
mkdir -p "$tmpdir/x"
T="$tmpdir/x" toru-path