Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #746 from gobuffalo/check-npm-early
Browse files Browse the repository at this point in the history
check for npm earlier in new apps
  • Loading branch information
markbates authored Nov 9, 2017
2 parents 3272037 + 7d929aa commit 7c55f47
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions generators/assets/webpack/webpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ var BinPath = filepath.Join("node_modules", ".bin", "webpack")
func (w Generator) Run(root string, data makr.Data) error {
g := makr.New()

// if there's no npm, return!
if _, err := exec.LookPath("npm"); err != nil {
fmt.Println("Could not find npm. Skipping webpack generation.")

return standard.Run(root, data)
}

command := "yarn"

if !w.WithYarn {
Expand All @@ -35,13 +42,6 @@ func (w Generator) Run(root string, data makr.Data) error {
}
}

// if there's no npm, return!
if _, err := exec.LookPath("npm"); err != nil {
fmt.Println("Could not find npm. Skipping webpack generation.")

return standard.Run(root, data)
}

g.Add(logo)

files, err := generators.Find(filepath.Join(generators.TemplatesPath, "assets", "webpack"))
Expand Down

0 comments on commit 7c55f47

Please sign in to comment.