nixpkgs/pkgs/applications/version-management/git-and-tools/transcrypt/helper-scripts_depspathprefix.patch
hyperfekt de5a9dea88 gitAndTools.transcrypt: query dependencies in helper scripts
adds a tool to get the paths of the dependencies needed by the helper scripts
(which are written only once and are never updated) to the output and patches
them to use it expand their path
2019-05-19 01:20:13 +09:00

38 lines
1.4 KiB
Diff

diff --git a/transcrypt b/transcrypt
index a0b562d..7888f5d 100755
--- a/transcrypt
+++ b/transcrypt
@@ -278,6 +278,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/clean"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
filename=$1
# ignore empty files
if [[ -s $filename ]]; then
@@ -300,6 +301,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/smudge"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
tempfile=$(mktemp 2> /dev/null || mktemp -t tmp)
trap 'rm -f "$tempfile"' EXIT
cipher=$(git config --get --local transcrypt.cipher)
@@ -309,6 +311,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/textconv"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
filename=$1
# ignore empty files
if [[ -s $filename ]]; then
@@ -351,7 +354,7 @@ save_configuration() {
git config merge.renormalize 'true'
# add a git alias for listing encrypted files
- git config alias.ls-crypt "!git ls-files | git check-attr --stdin filter | awk 'BEGIN { FS = \":\" }; /crypt$/{ print \$1 }'"
+ git config alias.ls-crypt "!PATH=\"\$(transcrypt-depspathprefix 2>/dev/null)\$PATH\"; git ls-files | git check-attr --stdin filter | awk 'BEGIN { FS = \":\" }; /crypt$/{ print \$1 }'"
}
# display the current configuration settings