diff options
author | EuAndreh <eu@euandre.org> | 2018-07-26 09:23:57 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-07-26 09:23:57 -0300 |
commit | e0aa824e55d977be49606ec9464286aaf8e89bcd (patch) | |
tree | be011b1d352b320ae150d7aecc345eb28e374674 | |
parent | Add keybind for relaoding projectile known projects (diff) | |
download | dotfiles-e0aa824e55d977be49606ec9464286aaf8e89bcd.tar.gz dotfiles-e0aa824e55d977be49606ec9464286aaf8e89bcd.tar.xz |
Use pushd+popd in merkle-tree to simplify usage
This way the end hash doesn't change whenever it is run from different directories.
-rw-r--r-- | bash/util.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bash/util.sh b/bash/util.sh index 4fc11ab..833bc9c 100644 --- a/bash/util.sh +++ b/bash/util.sh @@ -24,9 +24,11 @@ extract () { merkle-tree () { dirname="${1-.}" - find "$dirname" -type f | \ + pushd "$dirname" > /dev/null + find . -type f | \ sort | \ xargs -I{} sha256sum "{}" | \ sha256sum | \ awk '{print $1}' + popd > /dev/null } |