@gx-design-vue/create-gx-cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/create-gx-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "description": "a cli to bootstrap gx project",
6
6
  "main": "src/index.js",
package/src/cli.js CHANGED
@@ -79,7 +79,6 @@ async function promptForMissingOptions(options) {
79
79
  export async function cli() {
80
80
  let options = parseArgumentsIntoOptions()
81
81
  options = await promptForMissingOptions(options)
82
- console.log(options)
83
82
  if (options.template && options.projectName) {
84
83
  await createProject(options)
85
84
  }
package/src/main.js CHANGED
@@ -41,9 +41,15 @@ function editPackageJson(root, projectName) {
41
41
  fs.readFileSync(path.join(root, `package.json`), 'utf-8')
42
42
  )
43
43
 
44
- console.log(projectName)
45
-
46
44
  pkg.name = projectName
45
+
46
+ const dirIsExists = fs.existsSync(path.join(root, '.npmrc'))
47
+
48
+ if (!dirIsExists) {
49
+ writeFile(path.join(root, '.npmrc'), 'shamefully-hoist=true')
50
+ }
51
+
52
+
47
53
  writeFile(path.join(root, 'package.json'), JSON.stringify(pkg, null, 2))
48
54
  }
49
55
  }
@@ -112,7 +118,7 @@ export async function createProject(options) {
112
118
  task: () => copyTemplateFiles(templateDir, root)
113
119
  },
114
120
  options.template !== 'mobile-vant-html' ? {
115
- title: '项目文件修改',
121
+ title: '初始化项目',
116
122
  task: () => editPackageJson(root, options.projectName || getProjectName())
117
123
  } : {}
118
124
  ],