From 076d36625bf564fdc26af35848ef59b53e7ddecb Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Sat, 29 Jun 2019 15:01:17 +0200 Subject: [PATCH] Fix WithNodeJs opt Currently, the only way to generate a project with node is to use Webpack. If the --skip-webpack flag is used, WithNodeJs must be false then. --- buffalo/cmd/build.go | 5 ++++- buffalo/cmd/new.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/buffalo/cmd/build.go b/buffalo/cmd/build.go index e640b8d94..831d1c248 100644 --- a/buffalo/cmd/build.go +++ b/buffalo/cmd/build.go @@ -40,7 +40,10 @@ var xbuildCmd = &cobra.Command{ ctx, cancel := sigtx.WithCancel(context.Background(), os.Interrupt) defer cancel() - pwd, _ := os.Getwd() + pwd, err := os.Getwd() + if err != nil { + return err + } buildOptions.App = meta.New(pwd) if len(buildOptions.bin) > 0 { diff --git a/buffalo/cmd/new.go b/buffalo/cmd/new.go index 79796f5ff..eb103e186 100644 --- a/buffalo/cmd/new.go +++ b/buffalo/cmd/new.go @@ -9,11 +9,11 @@ import ( "path/filepath" "strings" - "github.com/gobuffalo/buffalo/genny/docker" pop "github.com/gobuffalo/buffalo-pop/genny/newapp" "github.com/gobuffalo/buffalo/genny/assets/standard" "github.com/gobuffalo/buffalo/genny/assets/webpack" "github.com/gobuffalo/buffalo/genny/ci" + "github.com/gobuffalo/buffalo/genny/docker" "github.com/gobuffalo/buffalo/genny/newapp/api" "github.com/gobuffalo/buffalo/genny/newapp/core" "github.com/gobuffalo/buffalo/genny/newapp/web" @@ -89,7 +89,7 @@ func parseNewOptions(args []string) (newAppOptions, error) { app.WithPop = !viper.GetBool("skip-pop") app.WithWebpack = !viper.GetBool("skip-webpack") app.WithYarn = !viper.GetBool("skip-yarn") - app.WithNodeJs = app.WithYarn || app.WithWebpack + app.WithNodeJs = app.WithWebpack app.AsWeb = !app.AsAPI if app.AsAPI {