Skip to content
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

Adds 'faas-cli template pull' command (rebase/review PR) #220

Merged
merged 11 commits into from
Nov 11, 2017

Conversation

alexellis
Copy link
Member

@alexellis alexellis commented Nov 11, 2017

Rebase / review PR with work from @ericstoekl @itscaro #201

ericstoekl and others added 5 commits November 11, 2017 16:46
Pull language templates from any repo that has a 'template/' directory
in the root with 'faas-cli template pull <github repo>'.

Also allows 'faas-cli new --lang' to list available languages

Signed-off-by: Eric Stoekl <ems5311@gmail.com>
Signed-off-by: Minh-Quan TRAN <account@itscaro.me>
1) Moves code that merges zip file contents into template/ dir into
expandTemplatesFromZip() function. Removes hard-coded constant.
2) Sort list of languages found with 'faas-cli new --list' before
printing
3) Fixes for typos, more descriptive comments, and remove incorrect
license attribution

Signed-off-by: Eric Stoekl <ems5311@gmail.com>
is not present in language template directory

Needs to add a 'template.yml' to each fake language template dir in
commands/testdata/new_function/template/<lang> in order to have current
tests pass. Deletes some unnecessary .gitignore files as a result.

Signed-off-by: Eric Stoekl <ems5311@gmail.com>
1) Improve readability by adding canExpandTemplateData() function, which
returns an enum telling what to do with the data found in the zip
archive.
2) Add function data to ARMHF directories in template/ dir
3) More descriptive naming for test array in language_template_test.go
and checkLanguage() function changed to templateFolderExists()

Signed-off-by: Eric Stoekl <ems5311@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
language := pathSplit[1]

// We know that this path is a directory if the last character is a "/"
isDirectory := relativePath[len(relativePath)-1:] == "/"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericstoekl we should be using strings.HasSuffix for this, no?

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
@alexellis alexellis merged commit 50be10b into master Nov 11, 2017
@alexellis alexellis changed the title Rebase pull templates PR Adds 'faas-cli template pull' command (rebase/review PR) Nov 11, 2017
@alexellis alexellis deleted the addTemplateCmd_mc1 branch May 23, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants