diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-10-11 15:24:10 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-10-11 15:24:10 +0200 |
commit | dc0153dc194a7d8d2414fbb12d96d52ffc164a4c (patch) | |
tree | 8a4e49e6f9011f68cc87b3cbe0de3341bb562d12 | |
parent | efaf7e9a8804c9f376bacf9fb64ecdb4dc108168 (diff) | |
download | nixos-dc0153dc194a7d8d2414fbb12d96d52ffc164a4c.tar nixos-dc0153dc194a7d8d2414fbb12d96d52ffc164a4c.tar.gz nixos-dc0153dc194a7d8d2414fbb12d96d52ffc164a4c.tar.bz2 nixos-dc0153dc194a7d8d2414fbb12d96d52ffc164a4c.tar.xz nixos-dc0153dc194a7d8d2414fbb12d96d52ffc164a4c.zip |
escaping
-rw-r--r-- | ymir.nix | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -894,23 +894,23 @@ in rec { | |||
894 | hook=${pkgs.writeScript "git-sync.sh" '' | 894 | hook=${pkgs.writeScript "git-sync.sh" '' |
895 | #!${pkgs.zsh}/bin/zsh | 895 | #!${pkgs.zsh}/bin/zsh |
896 | 896 | ||
897 | repository=$(git -C ${2:h} rev-parse --show-toplevel) | 897 | repository=$(git -C ''${2:h} rev-parse --show-toplevel) |
898 | [[ $? -eq 0 ]] || exit 0 | 898 | [[ $? -eq 0 ]] || exit 0 |
899 | 899 | ||
900 | git() { | 900 | git() { |
901 | $(whence -cp git) -C ${repository} ${@} | 901 | $(whence -cp git) -C ''${repository} ${@} |
902 | } | 902 | } |
903 | 903 | ||
904 | typeset -a changeSet | 904 | typeset -a changeSet |
905 | changeSet=() | 905 | changeSet=() |
906 | git diff -z --name-only | \ | 906 | git diff -z --name-only | \ |
907 | while IFS= read -r -d $'\0' change; do changeSet=(${changeSet} ${change}); done | 907 | while IFS= read -r -d $'\0' change; do changeSet=(''${changeSet} ''${change}); done |
908 | 908 | ||
909 | [[ ${changeSet[(i)$(realpath ${2} --relative-to=${repository})]} -le ${#changeSet} ]] || exit 0 | 909 | [[ ''${changeSet[(i)$(realpath ${2} --relative-to=''${repository})]} -le ''${#changeSet} ]] || exit 0 |
910 | 910 | ||
911 | commitMessage=$(printf "%s modified via infinoted" $(realpath ${2} --relative-to=${repository})) | 911 | commitMessage=$(printf "%s modified via infinoted" $(realpath ''${2} --relative-to=''${repository})) |
912 | git add ${2} | 912 | git add ''${2} |
913 | git commit -m ${commitMessage} --no-edit ${2} | 913 | git commit -m ''${commitMessage} --no-edit ''${2} |
914 | git push | 914 | git push |
915 | ''} | 915 | ''} |
916 | ''; | 916 | ''; |