Create and manage .gitignore file for function templates
When a templated function is created with the faas-cli new command then certain files are created and we should add them to the .gitignore file:
template
Used as a local cache of FaaS templates - this can be edited and committed but generally isn't
build
This is a temporary folder which is not supposed to be committed
Rules:
- Create .gitignore if none exists
- If one exists try to append these rules, but do not duplicate
I would like to work on these issue. Only these two rules should be added in .gitignore ?
is this still been worked?
@viveksyngh @gardlt
The .gitignore for the CLI should remain unchanged (I think #136 may be invalid). This Issue is about adding to the .gitignore file in the directory where faas-cli new is entered, and if it doesn't exist we have to create it:
i.e.
mkdir -p /tmp/test/
cd /tmp/test
faas-cli new tester1 --lang python
This should create /tmp/test/.gitignore with the entries:
template
build
Then if the .gitignore file exists should only add the entries (append) if they are not already present.
This will also need unit tests.
My bad misunderstood, PR. so the ask is that we want to add .gitignore file when we executing faas-cli new [command], correct?
@alexellis Should we skip the .gitignore file creation and proceed to next steps if we get any error during file creation or append ?
Right - so is anyone able to work on this?
I am working on it and implemented the logic. I need to test it.