Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
41 lines
948 B
Go
41 lines
948 B
Go
package ignitecmd
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
chainconfig "github.com/ignite/cli/v29/ignite/config/chain"
|
|
"github.com/ignite/cli/v29/ignite/pkg/cliui"
|
|
"github.com/ignite/cli/v29/ignite/pkg/cosmosgen"
|
|
)
|
|
|
|
// NewScaffoldVue scaffolds a Vue.js app for a chain.
|
|
func NewScaffoldVue() *cobra.Command {
|
|
c := &cobra.Command{
|
|
Use: "vue",
|
|
Short: "Vue 3 web app template",
|
|
Args: cobra.NoArgs,
|
|
PreRunE: migrationPreRunHandler,
|
|
RunE: scaffoldVueHandler,
|
|
}
|
|
|
|
c.Flags().AddFlagSet(flagSetYes())
|
|
|
|
return c
|
|
}
|
|
|
|
func scaffoldVueHandler(cmd *cobra.Command, _ []string) error {
|
|
session := cliui.New(
|
|
cliui.StartSpinnerWithText(statusScaffolding),
|
|
cliui.WithoutUserInteraction(getYes(cmd)),
|
|
)
|
|
defer session.End()
|
|
|
|
path := filepath.Join(".", chainconfig.DefaultVuePath)
|
|
if err := cosmosgen.Vue(path); err != nil {
|
|
return err
|
|
}
|
|
|
|
return session.Printf("\n🎉 Scaffolded a Vue.js app in %s.\n\n", path)
|
|
}
|