]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
tests: use sed to prepend to .env file
authorDaniel Hahler <git@thequod.de>
Mon, 24 Nov 2014 18:03:51 +0000 (19:03 +0100)
committerDaniel Hahler <git@thequod.de>
Mon, 24 Nov 2014 19:13:18 +0000 (20:13 +0100)
tests/recurse-upwards.t

index 508fb37cecc4ecf095df4e2c3281b614482f3632..6a4930f9a88ab12b18e5b5ca20bfed1ab5fa55d0 100644 (file)
@@ -50,7 +50,7 @@ Set timestamp of auth file into the past, so it gets seen as new below.
 
 Add sub/sub2/.env file, with a call to autoenv_source_parent.
 
-  $ echo -e "echo autoenv_source_parent_from_sub2:\nautoenv_source_parent\necho done_sub2\n" > sub2/.env
+  $ echo "echo autoenv_source_parent_from_sub2:\nautoenv_source_parent\necho done_sub2\n" > sub2/.env
   $ test_autoenv_add_to_env sub2/.env
   $ cd sub2
   autoenv_source_parent_from_sub2:
@@ -71,7 +71,8 @@ Move sub/.env away, now the root .env file should get sourced.
 Prepend call to autoenv_source_parent to sub/.env file.
 
   $ cd ..
-  $ echo -e "echo autoenv_source_parent_from_sub:\nautoenv_source_parent\n$(< .env)\necho done_sub" > .env
+  $ sed -i -e "1s/^/echo autoenv_source_parent_from_sub:\nautoenv_source_parent\n/" .env
+  $ echo "echo done_sub" >> .env
   $ touch -t 201401010103 .env
   $ test_autoenv_auth_env_files