]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
FIX: Compatibility with macOS/FreeBSD (#82)
authorRob Speed <speed.rob@gmail.com>
Fri, 15 Dec 2017 14:58:39 +0000 (09:58 -0500)
committerDaniel Hahler <github@thequod.de>
Fri, 15 Dec 2017 14:58:39 +0000 (15:58 +0100)
Removed use of `sed` due to its behavior differing between GNU Coreutils and FreeBSD.

tests/recurse-upwards.t

index a80353065c416a21062223edef0ea86e1e907870..f49cc3ecd041a8d85ec5fcd0c6bcbda04dbdced2 100644 (file)
@@ -71,7 +71,7 @@ Move sub/.autoenv.zsh away, now the root .autoenv.zsh file should get sourced.
 Prepend call to autoenv_source_parent to sub/.autoenv.zsh file.
 
   $ cd ..
-  $ sed -i -e "1s/^/echo autoenv_source_parent_from_sub:\nautoenv_source_parent\n/" .autoenv.zsh
+  $ echo -e "echo autoenv_source_parent_from_sub:\nautoenv_source_parent\n$(cat .autoenv.zsh)" >| .autoenv.zsh
   $ echo "echo done_sub" >> .autoenv.zsh
   $ touch -t 201401010103 .autoenv.zsh
   $ test_autoenv_auth_env_files