8000 disable module import for Stargate by ilgooz · Pull Request #278 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

disable module import for Stargate #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions starport/services/scaffolder/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"github.com/gobuffalo/genny"
"github.com/tendermint/starport/starport/pkg/cosmosver"
"github.com/tendermint/starport/starport/pkg/gomodulepath"
"github.com/tendermint/starport/starport/templates/add"
)
Expand All @@ -21,6 +22,13 @@ const (

// AddModule adds sepecified module with name to the scaffolded app.
func (s *Scaffolder) AddModule(name string) error {
version, err := s.version()
if err != nil {
return err
}
if version == cosmosver.Stargate {
return errors.New("importing modules currently is not supported on Stargate")
}
ok, err := isWasmAdded(s.path)
if err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions starport/services/scaffolder/scaffolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// to add more features in a later time.
package scaffolder

import "github.com/tendermint/starport/starport/pkg/cosmosver"

// Scaffolder is Starport app scaffolder.
type Scaffolder struct {
// path is app's path on the filesystem.
Expand All @@ -18,3 +20,7 @@ func New(path string, options ...Option) *Scaffolder {
options: newOptions(options...),
}
}

func (s *Scaffolder) version() (cosmosver.MajorVersion, error) {
return cosmosver.Detect(s.path)
}
2 changes: 1 addition & 1 deletion starport/services/scaffolder/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (s *Scaffolder) AddType(stype string, fields ...string) error {
Datatype: datatype,
})
}
version, err := cosmosver.Detect(s.path)
version, err := s.version()
if err != nil {
return err
}
Expand Down
0