Skip to content

Instantly share code, notes, and snippets.

@danielpza
Created December 13, 2023 02:48
Show Gist options
  • Save danielpza/321437f3a9f23ad36f6824220c3bc0c7 to your computer and use it in GitHub Desktop.
Save danielpza/321437f3a9f23ad36f6824220c3bc0c7 to your computer and use it in GitHub Desktop.
cloud functions gitignore hack
# HACK seems to be a bug with cloud functions gcloudignore, see https://stackoverflow.com/questions/52976199/gcloudignore-doesnt-allow-standard-wildcard-whitelist/54959530#54959530, https://unix.stackexchange.com/questions/247012/how-to-recursively-remove-all-but-list-of-files
gcloud meta list-files-for-upload >keep
rm -rf node_modules
files_to_delete=$(find . -type f | grep -vFf keep)
rm $(find . -type f | grep -vFf keep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment