Skip to content

Commit 3a62c61

Browse files
committed
v0.0.8
1 parent 4116414 commit 3a62c61

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ scf [operation] [function_name]
3232

3333
就不需要些过多介绍了,自己摸索吧。
3434

35+
使用 ESLint 全局管理云函数示例项目: <https://github.com/assholev0/scf-init-demo>
3536

3637
## License
3738

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "v0-scf",
3-
"version": "0.0.1",
3+
"version": "0.0.7",
44
"description": "腾讯云无服务器函数SCF命令行辅助工具",
55
"repository": "[email protected]:assholev0/v0-scf.git",
66
"author": "willin <[email protected]>",

src/lib/pack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = (fn = 'template') => {
2929
deferred.reject(err);
3030
});
3131
archive.pipe(output);
32-
archive.directory(fn === 'templage' ? path.join(__dirname, '../template/') : `./${fn}`, false);
32+
archive.directory(fn === 'template' ? path.join(__dirname, '../../template/') : `./${fn}`, false);
3333
archive.finalize();
3434
output.on('close', () => {
3535
deferred.resolve(

src/login.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const chalk = require('chalk');
33
const { SCF } = require('wqcloud');
44
const fs = require('fs');
55
const { globalPath, localPath } = require('./config');
6+
const { handler } = require('./lib/common');
67

78
const regions = [
89
'广州-华南地区(ap-guangzhou)',
@@ -63,11 +64,11 @@ module.exports = async () => {
6364
const { SecretId, SecretKey, Global } = answers;
6465
const [, Region = 'ap-guangzhou'] = answers.Region.match(/\(([\S]+)\)/) || [];
6566
const rcData = {
66-
SecretId, SecretKey, Region
67+
SecretId, SecretKey, Region, Version: '2018-04-16'
6768
};
6869
const sdk = SCF(rcData);
69-
const { codeDesc = '' } = await sdk.ListFunctions();
70-
if (codeDesc !== 'Success') {
70+
const result = await sdk.ListFunctions().then(handler('登录'));
71+
if (!result) {
7172
// eslint-disable-next-line no-console
7273
console.log(chalk`SecretId/SecretKey {red.bold 校验失败},请检查后重新尝试。`);
7374
return;

0 commit comments

Comments
 (0)