3 Star 4 Fork 3

anolis/test-lib-front

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
upload.js 872 Bytes
一键复制 编辑 原始数据 按行查看 历史
const shell = require('shelljs');
const path = require('path');
const argvParse = () => {
const { argv } = process
const [, , ...rest] = argv
return rest.reduce((pre, cur) => {
const [$key, $val] = cur.split("=")
pre[$key] = $val
return pre
}, {})
}
const uploadServerPath = path.resolve(process.cwd(), '..', 'upload.mjs');
const cmdObj = argvParse()
const getCommandComplateMap = (c) =>
new Map([
['v', 'version'],
['p', 'perfix'],
["k", "keep_version"]
]).get(c);
const command = Object.entries(cmdObj).reduce((pre, item) => {
const [$key, value] = item;
// eslint-disable-next-line no-param-reassign
return (pre += `${getCommandComplateMap($key)}=${value} `);
}, '');
const resultCommandString = `cross-env ${command} node ${uploadServerPath}`;
shell.exec(resultCommandString);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/anolis/test-lib-front.git
git@gitee.com:anolis/test-lib-front.git
anolis
test-lib-front
test-lib-front
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385