lileio / lile

Easily generate gRPC services in Go ⚡️
MIT License
1.51k stars 88 forks source link

Lile bootstrap does not work as in README #64

Closed piotrkochan closed 4 years ago

piotrkochan commented 5 years ago

In README:

Getting Started
To generate a new service, run lile new with a short folder path.

$ lile new lileio/users

In real life:

➜  ~ lile new piotrkochan/lile-test
Error: required flag(s) "name" not set

Trying with --name arg as in example (--name string the module name i.e (github.com/username/project):

➜  ~ lile new piotrkochan/lile-test --name "github.com/piotrkochan/lile-test"
Creating project in lile-test
Is this OK? [y]es/[n]o
Y
[...some code output...]
Could not format Go file {client.go lile-test/client.go client.tmpl}
[ERROR]: 1:13: expected ';', found '-'
panic: 1:13: expected ';', found '-'

Other try:

➜  ~ lile new piotrkochan/lile-test --name "github.com/piotrkochan"
Creating project in piotrkochan
Is this OK? [y]es/[n]o
Y
.
├── server
│   ├── server.go
│   └── server_test.go
├── subscribers
│   └── subscribers.go
├── piotrkochan
│   ├── cmd
│   │   ├── root.go
│   │   └── up.go
│   └── main.go
├── piotrkochan.proto
├── client.go
├── Makefile
├── Dockerfile
├── go.mod
└── .gitignore

l➜  ~ pwd
<my home>
l➜  ~ ls -l | grep lile
drwxr-xr-x   4 piotr  staff   128 Nov 20 20:55 lile-test

Generated code is not placed in $GOPATH as described but in the directory I'm currently in (is smart enough to parse your new service's name to create the service in the right place. seems a little bit wrong :))

➜  ~ go version
go version go1.12.5 darwin/amd64
arbarlow commented 5 years ago

hi @piotrkochan, I'm sorry you had a bad experience! It looks like using a - in the name field at the moment breaks things!

lile new piotrkochan/lile-test --name "github.com/piotrkochan/lile_test" would work fine! But I should definitely fix this

piotrkochan commented 5 years ago

All right, I'll try this tomorrow! Thanks for fast response

arbarlow commented 4 years ago

Closing due to inactivity, let me know if you need anything else!

piotrkochan commented 4 years ago

Sorry but it still does not work:

➜  kochan cd $GOPATH
➜  go lile new lileio/users
Error: required flag(s) "name" not set
Usage:
  lile new [name] [flags]

Flags:
      --dir string    the directory to create the service
  -h, --help          help for new
      --name string   the module name i.e (github.com/username/project)

required flag(s) "name" not set

I've tried like this:

➜  go pwd
/Users/piotr/go
➜  go lile new kochan/liletest --name "kochan/liletest"
Creating project in liletest
Is this OK? [y]es/[n]o
y
.
├── server
│   ├── server.go
│   └── server_test.go
├── subscribers
│   └── subscribers.go
├── liletest

I assume it should create project in $GOPATH/src/kochan/liletest directory. Now it is $GOPATH/liletest