From dc0153dc194a7d8d2414fbb12d96d52ffc164a4c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 11 Oct 2017 15:24:10 +0200 Subject: escaping --- ymir.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ymir.nix b/ymir.nix index b1adc5d4..58acb93d 100644 --- a/ymir.nix +++ b/ymir.nix @@ -894,23 +894,23 @@ in rec { hook=${pkgs.writeScript "git-sync.sh" '' #!${pkgs.zsh}/bin/zsh - repository=$(git -C ${2:h} rev-parse --show-toplevel) + repository=$(git -C ''${2:h} rev-parse --show-toplevel) [[ $? -eq 0 ]] || exit 0 git() { - $(whence -cp git) -C ${repository} ${@} + $(whence -cp git) -C ''${repository} ${@} } typeset -a changeSet changeSet=() git diff -z --name-only | \ - while IFS= read -r -d $'\0' change; do changeSet=(${changeSet} ${change}); done + while IFS= read -r -d $'\0' change; do changeSet=(''${changeSet} ''${change}); done - [[ ${changeSet[(i)$(realpath ${2} --relative-to=${repository})]} -le ${#changeSet} ]] || exit 0 + [[ ''${changeSet[(i)$(realpath ${2} --relative-to=''${repository})]} -le ''${#changeSet} ]] || exit 0 - commitMessage=$(printf "%s modified via infinoted" $(realpath ${2} --relative-to=${repository})) - git add ${2} - git commit -m ${commitMessage} --no-edit ${2} + commitMessage=$(printf "%s modified via infinoted" $(realpath ''${2} --relative-to=''${repository})) + git add ''${2} + git commit -m ''${commitMessage} --no-edit ''${2} git push ''} ''; -- cgit v1.2.3