Skip to content

Instantly share code, notes, and snippets.

@rumkin
Last active April 4, 2020 08:30
Show Gist options
  • Save rumkin/4517f370e7021e1df7c071b2eb22c36a to your computer and use it in GitHub Desktop.
Save rumkin/4517f370e7021e1df7c071b2eb22c36a to your computer and use it in GitHub Desktop.
Pack node project into tar with find
find-to-tar() {
local IN=${1:-.}
local OUT=${2:-archive.tar.gz}
find $IN -type f ! \( -path '*/node_modules/*' -o -path '*/dist/*' -o -path '*/build/*' \) | tar cvfz $OUT -T -
}
# Example:
# $ find-to-tar . arch.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment