Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/init.js')
-rw-r--r--lib/init.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/init.js b/lib/init.js
index e4bd20b72..e654793ec 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -19,7 +19,7 @@ class Init extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
- return ['yes', 'force', 'workspace', 'workspaces']
+ return ['yes', 'force', 'workspace', 'workspaces', 'include-workspace-root']
}
/* istanbul ignore next - see test/lib/load-all-commands.js */
@@ -54,6 +54,10 @@ class Init extends BaseCommand {
}
async initWorkspaces (args, filters) {
+ // if the root package is uninitiated, take care of it first
+ if (this.npm.flatOptions.includeWorkspaceRoot)
+ await this.init(args)
+
// reads package.json for the top-level folder first, by doing this we
// ensure the command throw if no package.json is found before trying
// to create a workspace package.json file or its folders