@htyf-mp/cli 0.0.1 → 0.0.3
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.
- package/README.md +1 -1
- package/cli.js +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
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
|
})
|
|
@@ -124,10 +129,17 @@ async function main() {
|
|
|
124
129
|
if (tempType === 'taro') {
|
|
125
130
|
appRootPath = `${appName}/${taroTempPath}`
|
|
126
131
|
await execa('rm', ['-r', `${appName}/${rnTempPath}`])
|
|
132
|
+
await execa('rm', ['-r', `${appName}/${gameTempPath}`])
|
|
127
133
|
}
|
|
128
134
|
if (tempType === 'react-native') {
|
|
129
135
|
appRootPath = `${appName}/${rnTempPath}`
|
|
130
136
|
await execa('rm', ['-r', `${appName}/${taroTempPath}`])
|
|
137
|
+
await execa('rm', ['-r', `${appName}/${gameTempPath}`])
|
|
138
|
+
}
|
|
139
|
+
if (tempType === 'game-cocos') {
|
|
140
|
+
appRootPath = `${appName}/${gameTempPath}`
|
|
141
|
+
await execa('rm', ['-r', `${appName}/${rnTempPath}`])
|
|
142
|
+
await execa('rm', ['-r', `${appName}/${taroTempPath}`])
|
|
131
143
|
}
|
|
132
144
|
await execa('rm', ['-r', `${appName}/cli`])
|
|
133
145
|
await execa('rm', ['-rf', `${appName}/.git`])
|
|
@@ -143,6 +155,11 @@ async function main() {
|
|
|
143
155
|
fs.writeFileSync(dgzJosn, JSON.stringify(config, undefined, 2))
|
|
144
156
|
console.log(dgzJosn)
|
|
145
157
|
}
|
|
158
|
+
if (tempType === 'game-cocos') {
|
|
159
|
+
const dgzJosn = `${appRootPath}/project.dgz.json`
|
|
160
|
+
fs.writeFileSync(dgzJosn, JSON.stringify(config, undefined, 2))
|
|
161
|
+
console.log(dgzJosn)
|
|
162
|
+
}
|
|
146
163
|
|
|
147
164
|
|
|
148
165
|
spinner.text = ''
|