You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide an easier way to create archive for pkg #769
It will be nice to provide additional flags to create archive when creating function/pkg.
Solution 1. Add new flags
--sourcearchive value, --src value Local path or URL for source archive
--deployarchive value, --deploy value Local path or URL for binary archive
--sourcedir value, --srcdir value Local path for source directory
--deploydir value, --deploydir value Local path for deploy directory
Solution 2. Change behavior of current flag, and retired some flag alias.
--src value Local path to source directory/archive or URL for source archive
--deploy value Local path to deployment directory/archive or URL for deployment archive
Agree fully with solving this issue. Though I am a bit worried that we degrade user experience if we keep adding parameters to the command.
What about allowing users to simply input a directory for --src or --deploy, and let the CLI handle both cases based on whether the input is a file, glob or a directory?
But looks like we need to retire sourcearchive and deployarchive as well to avoid confusion.
And --src hello.go --src world.go is not possible for now due to pkg constraint.
Sorry, I missed the thread notification. Originally, I thought that the flag can only accept one input, but I noticed we can use StringSlice to handle multiple inputs so the constraint I mentioned is no longer exists.
While working on this, I realized a few more cases/variations and I am documenting them here for future reference:
Following variations will work
--src hello.go => build single file
--src hello.go --src world.go or --src "*.go" => build package from multiple files
--src myFnDir/ => build package from directory
--src pkg.zip => Source archive - should work as it works today
--deploy somedir/ => deployment package from a directory
--deploy pkg.zip => Deploy archive - should work as it works today
--src/--deploy http://someurl/somefile.js - this should work but no tests currently
Following is not supported as of now:
--src dir1/ --src dir2/ => Multiple directory combinations
--deploy dir1/ --deploy dir2/ => Currently only single flag supported for deploy flag
Activity
erwinvaneyk commentedon Jul 3, 2018
Agree fully with solving this issue. Though I am a bit worried that we degrade user experience if we keep adding parameters to the command.
What about allowing users to simply input a directory for
--srcor--deploy, and let the CLI handle both cases based on whether the input is a file, glob or a directory?erwinvaneyk commentedon Jul 3, 2018
--src hello.go=> build single file--src hello.go --src world.goor--src *.go=> build package from multiple files--src myFnDir/=> build package from directorylife1347 commentedon Jul 3, 2018
@erwinvaneyk Oh! You're absolutely right! In this way, we don't need to add more flags to CLI
life1347 commentedon Jul 3, 2018
But looks like we need to retire
sourcearchiveanddeployarchiveas well to avoid confusion.And
--src hello.go --src world.gois not possible for now due to pkg constraint.erwinvaneyk commentedon Jul 3, 2018
I am all in favor of retiring some of the parameters, but I imagine that that is part of another discussion/issue. 😄
Could you explain this constraint a bit?
life1347 commentedon Jul 27, 2018
Sorry, I missed the thread notification. Originally, I thought that the flag can only accept one input, but I noticed we can use
StringSliceto handle multiple inputs so the constraint I mentioned is no longer exists.vishal-biyani commentedon Oct 10, 2018
While working on this, I realized a few more cases/variations and I am documenting them here for future reference:
Following variations will work
Following is not supported as of now:
life1347 commentedon Oct 15, 2018
Just wondering why
--src dir1/ --src dir2/is not support.Won't fetcher extracts them under the same directory like following?
For example,
The final directory structure will be: