Skip to content

Commit a1243f4

Browse files
lukebatchelorjamiebuilds
authored andcommitted
Adds proper check for script existing in bolt workspace run command
1 parent 8c90df2 commit a1243f4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

example/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"private": true,
33
"name": "fixture-project",
4-
"pworkspaces": [
5-
"packages/*"
6-
],
4+
"bolt": {
5+
"workspaces": ["packages/*"]
6+
},
77
"dependencies": {
88
"react": "^15.6.1"
99
}

example/packages/foo/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"postinstall": "echo postinstall",
88
"prepublish": "echo prepublish"
99
},
10-
"pworkspaces": [
11-
"packages/*"
12-
],
10+
"bolt": {
11+
"workspaces": ["packages/*"]
12+
},
1313
"dependencies": {
1414
"react": "^15.6.1",
1515
"bar-workspace-package": "^1.0.0"

src/commands/workspace/run.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ export async function workspaceRun(opts: WorkspaceRunOptions) {
3939
);
4040
}
4141

42-
let validScript = await yarn.run(workspace.pkg, opts.script, opts.scriptArgs);
42+
let validScript = await yarn.getScript(workspace.pkg, opts.script);
4343

4444
if (!validScript) {
4545
throw new BoltError(
4646
`Package at "${workspace.pkg
4747
.dir}" does not have a script named "${opts.script}"`
4848
);
4949
}
50+
await yarn.run(workspace.pkg, opts.script, opts.scriptArgs);
5051
}

0 commit comments

Comments
 (0)