Skip to content

Instantly share code, notes, and snippets.

@nmrshll
Created November 6, 2020 19:03
Show Gist options
  • Save nmrshll/c0f241604f18d1ef0d16c4d50fe54464 to your computer and use it in GitHub Desktop.
Save nmrshll/c0f241604f18d1ef0d16c4d50fe54464 to your computer and use it in GitHub Desktop.
# hash a dir
code_sha=$(shell echo $(shell find substrate-node-template -path "*target" -prune -type f -o -exec echo {} \; | xargs -I "{}" date -r {} "+%s") | $(shell [[ `uname`="Darwin" ]] &&echo "shasum -a 256" ||echo sha256sum) | cut -d" " -f1)
# get a dir's last modified timestamp
# ?rebuild=[[ $(shell date -r ${node} "+%s" || echo 0) -lt $(shell find substrate-node-template -print0 | xargs -0 -I "{}" date -r {} "+%s" | sort -nr | head -1 || echo 0) ]] # macos only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment