fnproject/cli

fn init adds erroneous boilerplate to function dir w/ code existing

rdallman opened this issue · 0 comments

I have a Dockerfile and a go file in a directory, which is not named func.go (but is an fdk-friendly function). it looks like this:

✗: ls                   
build.sh  Dockerfile  fn-test-utils.go  Gopkg.lock  Gopkg.toml  release.sh

I run this:

✗: cli init --runtime go
Dockerfile found. Using runtime 'docker'.  
Function boilerplate generated.                  
func.yaml created.      
✗: git st                                       
## master...origin/master                         
 M ../../api/server/runner_fninvoke_test.go
?? func.go                                                                  
?? func.yaml                                
?? go.mod 

probably, since we detected runtime docker we shouldn't add boilerplate (for any lang, not just go)? seems odd anyway, I had to delete the file. basic assumption being if we find a dockerfile it's probably a valid function we just need to add it to fn? idk