Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

my-ci

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

my-ci - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

25

bin/workspace-init.js

@@ -32,3 +32,3 @@ #!/usr/bin/env node

projectName = ymlConfig.project
newWorkspace(projectName);
newWorkspace(projectName, args['--force']);
} else {

@@ -39,8 +39,3 @@ throw 'project属性不能为空';

if (err?.code === 'EEXIST') {
if (args['--force']) {
newWorkspace(projectName);
console.log('已覆盖');
} else {
console.error(`${projectName}已存在,请在yml配置中设置一个不重复的project属性,或者使用-F覆盖`);
}
console.error(`${projectName}已存在,请在yml配置中设置一个不重复的project属性,或者使用-F覆盖`);
} else if (err?.code === 'ENOENT') {

@@ -53,3 +48,3 @@ console.error(`没有找到配置文件: ${configFileName}`);

function newWorkspace(projectName) {
function newWorkspace(projectName, force) {
// .my-ci文件夹不存在则先创建

@@ -69,5 +64,17 @@ try {

const wsInfoPath = path.resolve(os.homedir(), dataDir, projectName);
fs.openSync(wsInfoPath, 'wx'); // 如果文件已经存在,会抛出错误
try {
fs.openSync(wsInfoPath, 'wx'); // 如果文件已经存在,会抛出错误
} catch (e) {
if (err?.code === 'EEXIST') {
if (force) {
fs.unlinkSync(wsInfoPath);
console.log('删除已有work信息');
} else {
throw e;
}
}
}
fs.writeFileSync(wsInfoPath, `PATH=${projectRootPath}`);
console.log('my-ci project created successfully.');
}
{
"name": "my-ci",
"version": "1.0.5",
"version": "1.0.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc