Skip to content

Allow upload of all files in directory w/out require glob patterns #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
djfarrelly opened this issue Jun 6, 2019 · 0 comments
Open

Comments

@djfarrelly
Copy link
Contributor

Purpose

It can get a bit tedious to write our all of the file glob patterns and with directories that are pretty clean, we don't need this high level of control.

Notes

Currently, lots of our apps are using bash to work around this which lens to complex and verbose code:

FILE_GLOBS=(
  'public/css/*.css'
  'public/js/*.js'
  'public/img/*.*'
  'public/img/**/*.*'
  'public/img/**/**/*.*'
  'public/video/*.*'
  'public/video/**/*.*'
  'public/misc/*.*'
  'public/fonts/*.*'
  'static/**/*.*'
)
# this joins the above array into a comma-delineated string
FILES=$(printf ",%s" "${FILE_GLOBS[@]}") 
FILES=${FILES:1} # slice the first "," char

./buffer-static-upload -files "$FILES" -dir marketing

Idea

We could simplify this as we're uploading everything in static with that glob and most of the other directories which gets a bit verbose. We traverse the entire directory and upload all files, perhaps skipping .DS_Store's. and other files like that.

./buffer-static-upload -files "public,static" -dir marketing

Optional bonus idea
We could add an argument like -ext to allow someone to only match certain extensions in a given directory.

./buffer-static-upload -files "public,static" -dir marketing -ext "js,css,mp4,woff"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant