@htyf-mp/cli 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +14 -0
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -26,6 +26,7 @@ const repoUrl = 'https://github.com/htyf-mp-community/htyf-mp.git'
26
26
 
27
27
  const taroTempPath = 'mini-apps-template-taro';
28
28
  const rnTempPath = 'mini-apps-template-rn';
29
+ const gameTempPath = 'mini-game-template-cocos';
29
30
 
30
31
  const isYarnInstalled = () => {
31
32
  try {
@@ -100,6 +101,10 @@ async function main() {
100
101
  {
101
102
  name: 'ReactNative',
102
103
  value: 'react-native',
104
+ },
105
+ {
106
+ name: 'Game',
107
+ value: 'game-cocos',
103
108
  }
104
109
  ]
105
110
  })
@@ -129,6 +134,10 @@ async function main() {
129
134
  appRootPath = `${appName}/${rnTempPath}`
130
135
  await execa('rm', ['-r', `${appName}/${taroTempPath}`])
131
136
  }
137
+ if (tempType === 'game-cocos') {
138
+ appRootPath = `${appName}/${gameTempPath}`
139
+ await execa('rm', ['-r', `${appName}/${gameTempPath}`])
140
+ }
132
141
  await execa('rm', ['-r', `${appName}/cli`])
133
142
  await execa('rm', ['-rf', `${appName}/.git`])
134
143
  } catch (err) {}
@@ -143,6 +152,11 @@ async function main() {
143
152
  fs.writeFileSync(dgzJosn, JSON.stringify(config, undefined, 2))
144
153
  console.log(dgzJosn)
145
154
  }
155
+ if (tempType === 'game-cocos') {
156
+ const dgzJosn = `${appRootPath}/project.dgz.json`
157
+ fs.writeFileSync(dgzJosn, JSON.stringify(config, undefined, 2))
158
+ console.log(dgzJosn)
159
+ }
146
160
 
147
161
 
148
162
  spinner.text = ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htyf-mp/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "红糖云服app小程序模板-cli",
5
5
  "type": "module",
6
6
  "bin": "cli.js",