diff --git a/starport/services/serve/plugin-stargate.go b/starport/services/serve/plugin-stargate.go index 6f7d878b09..e74e6ed6c4 100644 --- a/starport/services/serve/plugin-stargate.go +++ b/starport/services/serve/plugin-stargate.go @@ -84,7 +84,7 @@ func (p *stargatePlugin) PostInit() error { if err != nil { return err } - path := filepath.Join(home, p.app.nd(), "config/app.toml") + path := filepath.Join(home, fmt.Sprintf(".%s/config/app.toml", p.app.nd())) config, err := toml.LoadFile(path) if err != nil { return err @@ -122,5 +122,5 @@ func (p *stargatePlugin) StoragePaths() []string { } func (p *stargatePlugin) GenesisPath() string { - return fmt.Sprintf("%s/config/genesis.json", p.app.nd()) + return fmt.Sprintf(".%s/config/genesis.json", p.app.nd()) } diff --git a/starport/templates/add/new.go b/starport/templates/add/new.go index bd8e097995..2e69f117d5 100644 --- a/starport/templates/add/new.go +++ b/starport/templates/add/new.go @@ -14,7 +14,6 @@ import ( func New(opts *Options) (*genny.Generator, error) { g := genny.New() g.RunFn(appModify(opts)) - g.RunFn(cmdMainModify(opts)) if err := g.Box(packr.New("wasm", "./wasm")); err != nil { return g, err } @@ -94,24 +93,3 @@ func appModify(opts *Options) genny.RunFn { return r.File(newFile) } } - -func cmdMainModify(opts *Options) genny.RunFn { - return func(r *genny.Runner) error { - path := fmt.Sprintf("cmd/%[1]vcli/main.go", opts.AppName) - f, err := r.Disk.Find(path) - if err != nil { - return err - } - template := `%[1]v - wasmrest "github.com/CosmWasm/wasmd/x/wasm/client/rest"` - replacement := fmt.Sprintf(template, placeholder) - content := strings.Replace(f.String(), placeholder, replacement, 1) - - template2 := `%[1]v - wasmrest.RegisterRoutes(rs.CliCtx, rs.Mux)` - replacement2 := fmt.Sprintf(template2, placeholder2) - content = strings.Replace(content, placeholder2, replacement2, 1) - newFile := genny.NewFileS(path, content) - return r.File(newFile) - } -}