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

make sure yarn uses --no-progress #554

Merged
merged 2 commits into from
Jul 24, 2017
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
5 changes: 5 additions & 0 deletions buffalo/cmd/generate/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ var DockerCmd = &cobra.Command{
"docker": dockerOptions.Style,
"asWeb": webpack,
"withWepack": webpack,
"withYarn": false,
}

if _, err := os.Stat("yarn.lock"); err == nil {
data["withYarn"] = true
}

g, err := docker.New()
Expand Down
1 change: 1 addition & 0 deletions buffalo/cmd/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func genNewFiles() error {
"withPop": !app.SkipPop,
"withDep": app.WithDep,
"withWebpack": !app.SkipWebpack && !app.API,
"withYarn": app.WithYarn,
"dbType": app.DBType,
"version": Version,
"ciProvider": app.CIProvider,
Expand Down
2 changes: 1 addition & 1 deletion buffalo/cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func yarnCheck() error {
return errors.Errorf("This application require yarn, and we could not find it installed on your system. We tried to install it for you, but ran into the following error:\n%s", err)
}
}
err = run(exec.Command("yarn", "install"))
err = run(exec.Command("yarn", "--no-progress", "install"))
if err != nil {
return errors.Errorf("We encountered the following error when trying to install your asset dependencies using yarn:\n%s", err)
}
Expand Down
6 changes: 5 additions & 1 deletion generators/docker/multi/templates/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ WORKDIR $GOPATH/src/{{.packagePath}}
{{if .withWebpack -}}
# this will cache the npm install step, unless package.json changes
ADD package.json .
RUN npm install
{{if .withYarn -}}
RUN yarn install --no-progress
{{else -}}
RUN npm install --no-progress
{{end -}}
{{end -}}

ADD . .
Expand Down
6 changes: 5 additions & 1 deletion generators/docker/standard/templates/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ WORKDIR $GOPATH/src/{{.packagePath}}
{{if .withWebpack -}}
# this will cache the npm install step, unless package.json changes
ADD package.json .
RUN npm install
{{if .withYarn -}}
RUN yarn install --no-progress
{{else -}}
RUN npm install --no-progress
{{end -}}
{{end -}}
{{end -}}

Expand Down