@htyf-mp/cli 0.0.7 → 0.0.9
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/cli.js +17 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -24,6 +24,7 @@ const program = new Command()
|
|
|
24
24
|
const green = chalk.green
|
|
25
25
|
|
|
26
26
|
const repoUrl = 'https://github.com/htyf-mp-community/htyf-mp.git'
|
|
27
|
+
const codingRepoUrl = 'https://e.coding.net/dagouzhi/hongtangyun_mobile/htyf-mp.git'
|
|
27
28
|
|
|
28
29
|
const taroTempPath = 'mini-apps-template';
|
|
29
30
|
const expoTempPath = 'mini-apps-template';
|
|
@@ -110,6 +111,20 @@ async function main() {
|
|
|
110
111
|
]
|
|
111
112
|
})
|
|
112
113
|
|
|
114
|
+
const repoType = await select({
|
|
115
|
+
message: '请选择模板镜像?',
|
|
116
|
+
choices: [
|
|
117
|
+
{
|
|
118
|
+
name: 'github(最新)',
|
|
119
|
+
value: repoUrl,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'github(最快)',
|
|
123
|
+
value: codingRepoUrl,
|
|
124
|
+
},
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
|
|
113
128
|
const appid = md5(uuidv4(v4options));
|
|
114
129
|
|
|
115
130
|
let config = {
|
|
@@ -124,7 +139,7 @@ async function main() {
|
|
|
124
139
|
log(`\n初始化项目. \n`)
|
|
125
140
|
|
|
126
141
|
spinner.start()
|
|
127
|
-
await execa('git', ['clone',
|
|
142
|
+
await execa('git', ['clone', repoType, appName])
|
|
128
143
|
let appRootPath = '';
|
|
129
144
|
try {
|
|
130
145
|
if (tempType === 'taro') {
|
|
@@ -147,7 +162,7 @@ async function main() {
|
|
|
147
162
|
} catch (err) {}
|
|
148
163
|
const __TEMP_PATH__ = path.join(appRootPath, '__TEMP__');
|
|
149
164
|
const pkg_path = path.join(appRootPath, './package.json');
|
|
150
|
-
const dgzJosn = path.join(`${appRootPath}`, project.dgz.json)
|
|
165
|
+
const dgzJosn = path.join(`${appRootPath}`, 'project.dgz.json')
|
|
151
166
|
if (tempType === 'taro') {
|
|
152
167
|
fse.closeSync(
|
|
153
168
|
path.join(__TEMP_PATH__, 'taro_src'),
|