代码拉取完成,页面将自动刷新
/** @format */
import path from 'path';
import os from 'os';
import fs from 'fs-extra';
import logger from './src/utils/logger';
import yaml from 'js-yaml';
jestBeforeDetection();
function jestBeforeDetection() {
if (!detectioIsExist('.s/access.yaml')) {
logger.error(`Failed to execute:\n
❌ Message: Please install S component
😈 If you have questions, please tell us: https://github.com/Serverless-Devs/Serverless-Devs/issues\n`);
process.exit(-1);
}
if (Object.keys(getAccessFile()).length === 0) {
logger.error(`Failed to execute:\n
❌ Message: Please configure your Secret
😈 If you have questions, please tell us: https://github.com/Serverless-Devs/Serverless-Devs/issues\n`);
process.exit(-1);
}
}
function detectioIsExist(road) {
return fs.existsSync(getPath(road));
}
function getAccessFile() {
const accessFile = getPath('.s/access.yaml');
const accessFileInfo = yaml.load(fs.readFileSync(accessFile, 'utf-8') || '{}');
return accessFileInfo;
}
function getPath(road) {
return path.join(os.homedir(), road);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。