Documentation ¶
Overview ¶
Package npm contains NpmCmd which generates new npm project using template.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NpmCmd = &cobra.Command{ Use: "npm", Short: "Start a new project using 'npm' template", Long: "Start a new project using 'npm' template", Run: func(cmd *cobra.Command, args []string) { answers := struct { License string ProjectDescription string ProjectName string }{} if err := survey.Ask(questions, &answers); err != nil { utils.ExitOnError(err) } templates := []string{"new/npm", "new/github", "new/license"} requireMap := map[string]interface{}{} replaceMap := map[string]interface{}{ "author": config.GetConfigByField("author"), "email": config.GetConfigByField("email"), "githubUser": config.GetConfigByField("githubUser"), "license": answers.License, "projectDescription": answers.ProjectDescription, "projectName": answers.ProjectName, } utils.GenerateFile(templates, answers.ProjectName, requireMap, replaceMap) bold := color.New(color.Bold).SprintFunc() boldCyan := color.New(color.FgCyan, color.Bold).SprintFunc() fmt.Println() fmt.Printf("%s%s%s\n", bold("This project uses "), boldCyan("Commitlint"), bold(", see more detail here: https://github.com/Armour/commitlint-config-armour")) }, }
NpmCmd generates new npm project using template.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.