Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

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

Description

@djfarrelly

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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions