Open techjeffharris opened 7 years ago
Is a google apps feature? The script project is simple. It don't need packages. I'm using npm scrips for this.
Just my ¢50
I initially wanted to pursue something like this but avoided it due to the additional complexity. I think this is a feature worth adding if it's opt-in like you desribed; the primary issue is that the "directory separator" can't be used in the filename at all, so something like _
would probably run into issues if people aren't aware of that restriction.
perhaps something that would never occur in a filename like _-_
might work well? Regardless, I support adding this but don't have the time to work on it myself.
I have no opinions on the separator, other than agreeing that _
is likely not the best default due to its already ubiquitous use in filenames.
Also, I still haven't taken any look at the code, sorry.. hopefully soon? ¯_(ツ)_/¯
Here's my brainstorm of a solution to the enable duplicate filenames when in separate local directories:
Say we add a couple keys to
gapps.config.json
"enable_dirs" : false
, and"seperator_placeholder" : "_"
then create a flag for the
upload
/push
commands to collapse of the directory structure within/src
:Now, let's suppose I have a gapps project:
With the new behavior, if I call
$ gapps upload -d
My project will upload as such:
The same flag could be added to the
init
/clone
commands to request the reciprocal effect--convert the default/specifiedPLACEHOLDER
withpath.separator()
, then create files/folder accordingly.Also, if a person wants to do this folder conversion at all, they probably want it done automatically, so
--enable-dirs=PLACEHOLDER
would update thegapps.config.json
key"enable_dirs"
totrue
and update"separator_placeholder"
withPLACEHOLDER
, if specified.If we are going to have a sticky flag to enable diretory support, we should also have
--disable-dirs
to disable directory support which would essentially set"enable_dirs"
tofalse
.I hope to submit a pull request once I spend the time to wrap my head around the code, but I figured I would see if anywone else is interested in this!
Thanks for all the hard work!