automan-cmd 2.1.5 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,7 +103,7 @@ async function ossUpload({
103
103
  if (/\.tmp$/.test(file)) continue
104
104
  util.log(`\n上传文件${file}`)
105
105
  let filekey = `${COMPONENT_PATH.split(/[/@]/).join('/')}/${file.replace(/^dist[\/]/, '')}`
106
- var fileurl = `${credentials.host}/${credentials.dir}${filekey}`
106
+ var fileurl = `${credentials.urlPrefix}/${credentials.dir}${filekey}`
107
107
 
108
108
  try {
109
109
  if (/(index|editor)\.js$/.test(file)) {
@@ -115,7 +115,7 @@ async function ossUpload({
115
115
  name: package.name
116
116
  })
117
117
  }
118
-
118
+
119
119
  await upload(filekey, path.resolve(CWD, file), credentials)
120
120
  } catch (err) {
121
121
  util.logRed(err.message || err)
@@ -206,7 +206,7 @@ async function checkComponent({
206
206
  })
207
207
  }
208
208
 
209
- async function addComponent(mainFile, package,visibilitylevel) {
209
+ async function addComponent(mainFile, package, visibilitylevel) {
210
210
  await axios({
211
211
  url: ADD_COMPONENT,
212
212
  headers: {
@@ -242,7 +242,7 @@ async function getCredentials() {
242
242
  })
243
243
  .then(({data})=>{
244
244
  if(data.code===1){
245
- return data.data
245
+ return data.data
246
246
  }else{
247
247
  throw new Error(data.msg || '获取oss token 失败')
248
248
  }
@@ -258,19 +258,19 @@ async function getCredentials() {
258
258
  async function start() {
259
259
  // 询问是否公开组件
260
260
  // const visibilitylevel = Number(await util.confirm('是否设置该组件为所有人可见'))
261
-
261
+
262
262
  //通过输入确定是否公开组件
263
263
  async function pleaseAnswerMe () {
264
264
  let answer
265
265
  while (!(/^[YyNn]$/).test(answer = await getAnswer())) {
266
266
  util.logRed('请输入Y/N(不区分大小写)来选择是否公开(官方)组件')
267
267
  }
268
-
268
+
269
269
  async function getAnswer () {
270
270
  let _answer= (await util.quiz('请输入Y/N(不区分大小写)来选择是否公开(官方)组件')).trim()
271
271
  return _answer
272
272
  }
273
-
273
+
274
274
  if(answer === 'Y' || answer === 'y'){
275
275
  answer = true
276
276
  }else{
@@ -323,7 +323,7 @@ async function start() {
323
323
  package
324
324
  })
325
325
 
326
- await addComponent(mainFile, package,visibilitylevel)
326
+ await addComponent(mainFile, package, visibilitylevel)
327
327
  util.logGreen('\n发布成功')
328
328
  util.logGreen(COMPONENT_PATH)
329
329
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automan-cmd",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "奥特曼脚手架",
5
5
  "bin": {
6
6
  "automan": "bin/automan",
@@ -34,4 +34,4 @@
34
34
  "runscript": "^1.6.0",
35
35
  "unzip": "^0.1.11"
36
36
  }
37
- }
37
+ }