From 46d0e0d52bea4ab37d5eeff6af078be938e24606 Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Thu, 6 Jan 2022 18:19:39 -0800 Subject: [PATCH 1/4] QoL changes for using examples --- cli/internal/run/run.go | 15 ++++++++------- cli/npm/turbo-install/bin/turbo | 15 ++++++++++----- examples/.yarnrc | 2 ++ 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 examples/.yarnrc diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index d403c2ad71575..d6e8b26fe9c88 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -445,9 +445,7 @@ func (c *RunCommand) Run(args []string) int { // Cache --------------------------------------------- var hit bool - if runOptions.forceExecution { - hit = false - } else { + if !runOptions.forceExecution { hit, _, err = turboCache.Fetch(pack.Dir, hash, nil) if err != nil { targetUi.Error(fmt.Sprintf("error fetching from cache: %s", err)) @@ -461,10 +459,13 @@ func (c *RunCommand) Run(args []string) int { return nil } - } - - if runOptions.stream { - targetUi.Output(fmt.Sprintf("cache miss, executing %s", ui.Dim(hash))) + if runOptions.stream { + targetUi.Output(fmt.Sprintf("cache miss, executing %s", ui.Dim(hash))) + } + } else { + if runOptions.stream { + targetUi.Output("cache bypassed, executing") + } } // Setup command execution diff --git a/cli/npm/turbo-install/bin/turbo b/cli/npm/turbo-install/bin/turbo index cfbe298fc0197..d9982618c1d31 100755 --- a/cli/npm/turbo-install/bin/turbo +++ b/cli/npm/turbo-install/bin/turbo @@ -2,8 +2,13 @@ const { generateBinPath } = require("../node-platform"); -require("child_process").execFileSync( - generateBinPath(), - process.argv.slice(2), - { stdio: "inherit" } -); +try { + require("child_process").execFileSync( + generateBinPath(), + process.argv.slice(2), + { stdio: "inherit" } + ); +} catch(e) { + if(e && e.status) process.exit(e.status); + throw e; +} diff --git a/examples/.yarnrc b/examples/.yarnrc new file mode 100644 index 0000000000000..1abbaf2e382db --- /dev/null +++ b/examples/.yarnrc @@ -0,0 +1,2 @@ +env: + "TURBO_BINARY_PATH" ./../../cli/turbo From d0fcb35e0464aa3978f5350376bb58f70e682ff8 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 7 Jan 2022 11:07:58 -0500 Subject: [PATCH 2/4] Update cache bypass log --- cli/internal/run/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index d6e8b26fe9c88..f73764b7c6406 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -464,7 +464,7 @@ func (c *RunCommand) Run(args []string) int { } } else { if runOptions.stream { - targetUi.Output("cache bypassed, executing") + targetUi.Output(fmt.Sprintf("cache bypass, force executing %s", ui.Dim(hash))) } } From 64df51ff0aded3f27650a12e9dae8fdcc29e25d3 Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Mon, 10 Jan 2022 10:07:54 -0800 Subject: [PATCH 3/4] remove yarnrc --- examples/.yarnrc | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 examples/.yarnrc diff --git a/examples/.yarnrc b/examples/.yarnrc deleted file mode 100644 index 1abbaf2e382db..0000000000000 --- a/examples/.yarnrc +++ /dev/null @@ -1,2 +0,0 @@ -env: - "TURBO_BINARY_PATH" ./../../cli/turbo From 53f19920f9fc1f17c581869323017876d3ac287a Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Mon, 10 Jan 2022 10:09:20 -0800 Subject: [PATCH 4/4] Fix Ken's twitter handle --- docs/pages/docs/acknowledgments.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/docs/acknowledgments.mdx b/docs/pages/docs/acknowledgments.mdx index 19e81edb2d3b5..c80e09ca416ee 100644 --- a/docs/pages/docs/acknowledgments.mdx +++ b/docs/pages/docs/acknowledgments.mdx @@ -39,6 +39,6 @@ Additionally, we're grateful to: - [Rick Button](https://twitter.com/rickbutton) for donating the `turbo` package name on NPM - [Iheanyi Ekechukwu](https://twitter.com/kwuchu) for helping Jared pick up Golang during the Pandemic! -- [Kenneth Chau](https://twitter.com/kennethchau) for Lage's Scope and Pipeline API and docs +- [Kenneth Chau](https://twitter.com/kenneth_chau) for Lage's Scope and Pipeline API and docs - [Miguel Oller](https://mobile.twitter.com/ollermi) and [MakeSwift.com](https://makeswift.com) for piloting Turbo - [Eric Koslow](https://twitter.com/ekosz1), [Jack Hanford](https://twitter.com/jackhanford), and [Lattice.com](https://lattice.com) for piloting Turbo