faas-cli icon indicating copy to clipboard operation
faas-cli copied to clipboard

Create and manage .gitignore file for function templates

Open alexellis opened this issue 9 years ago • 7 comments

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

alexellis avatar Sep 29 '17 06:09 alexellis

I would like to work on these issue. Only these two rules should be added in .gitignore ?

viveksyngh avatar Sep 29 '17 10:09 viveksyngh

is this still been worked?

gardlt avatar Oct 01 '17 21:10 gardlt

@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.

alexellis avatar Oct 02 '17 11:10 alexellis

My bad misunderstood, PR. so the ask is that we want to add .gitignore file when we executing faas-cli new [command], correct?

gardlt avatar Oct 03 '17 02:10 gardlt

@alexellis Should we skip the .gitignore file creation and proceed to next steps if we get any error during file creation or append ?

viveksyngh avatar Oct 03 '17 03:10 viveksyngh

Right - so is anyone able to work on this?

alexellis avatar Oct 03 '17 09:10 alexellis

I am working on it and implemented the logic. I need to test it.

viveksyngh avatar Oct 03 '17 09:10 viveksyngh