Skip to content

Commit

Permalink
add cpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
yukukotani committed Sep 1, 2023
1 parent b674c42 commit 0220186
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Install extends ArboristWorkspaceCmd {
'bin-links',
'fund',
'dry-run',
'cpu',
...super.params,
]

Expand Down
2 changes: 2 additions & 0 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"cidr": null,
"color": true,
"commit-hooks": true,
"cpu": null,
"depth": null,
"description": true,
"dev": false,
Expand Down Expand Up @@ -187,6 +188,7 @@ cert = null
cidr = null
color = true
commit-hooks = true
cpu = null
depth = null
description = true
dev = false
Expand Down
19 changes: 17 additions & 2 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,16 @@ Run git commit hooks when using the \`npm version\` command.
#### \`cpu\`
* Default: null
* Type: null or String
Override CPU architecture of native modules to install. Acceptable values
are same as \`cpu\` field of package.json, which comes from \`process.arch\`.
#### \`depth\`
* Default: \`Infinity\` if \`--all\` is set, otherwise \`1\`
Expand Down Expand Up @@ -2006,6 +2016,7 @@ Array [
"cidr",
"color",
"commit-hooks",
"cpu",
"depth",
"description",
"dev",
Expand Down Expand Up @@ -2159,6 +2170,7 @@ Array [
"cidr",
"color",
"commit-hooks",
"cpu",
"depth",
"description",
"dev",
Expand Down Expand Up @@ -2313,6 +2325,7 @@ Object {
"cidr": null,
"color": false,
"commitHooks": true,
"cpu": null,
"defaultTag": "latest",
"depth": null,
"diff": Array [],
Expand Down Expand Up @@ -3170,7 +3183,7 @@ Options:
[--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only]
[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links]
[--no-fund] [--dry-run]
[--no-fund] [--dry-run] [--cpu <cpu>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--install-links]
Expand Down Expand Up @@ -3201,6 +3214,7 @@ aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
#### \`bin-links\`
#### \`fund\`
#### \`dry-run\`
#### \`cpu\`
#### \`workspace\`
#### \`workspaces\`
#### \`include-workspace-root\`
Expand Down Expand Up @@ -3261,7 +3275,7 @@ Options:
[--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only]
[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links]
[--no-fund] [--dry-run]
[--no-fund] [--dry-run] [--cpu <cpu>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--install-links]
Expand Down Expand Up @@ -3292,6 +3306,7 @@ alias: it
#### \`bin-links\`
#### \`fund\`
#### \`dry-run\`
#### \`cpu\`
#### \`workspace\`
#### \`workspaces\`
#### \`include-workspace-root\`
Expand Down
11 changes: 11 additions & 0 deletions workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,17 @@ define('commit-hooks', {
flatten,
})

define('cpu', {
default: null,
type: [null, String],
description: `
Override CPU architecture of native modules to install.
Acceptable values are same as \`cpu\` field of package.json,
which comes from \`process.arch\`.
`,
flatten,
})

define('depth', {
default: null,
defaultDescription: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Object {
"commit-hooks": Array [
"boolean value (true or false)",
],
"cpu": Array [
null,
Function String(),
],
"depth": Array [
null,
"numeric value",
Expand Down

0 comments on commit 0220186

Please sign in to comment.