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

@cplace/cli

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cplace/cli - npm Package Compare versions

Comparing version 0.19.20 to 0.19.21

1

dist/commands/repos/AbstractReposCommand.d.ts

@@ -22,2 +22,3 @@ import { ICommand, ICommandParameters } from '../models';

protected writeNewParentRepos(newParentRepos: IReposDescriptor): Promise<void>;
protected convertLineEndings(content: string): string;
}

@@ -18,5 +18,5 @@ "use strict";

const fs = require("fs");
const util_1 = require("../../util");
const path = require("path");
const rimraf = require("rimraf");
const eol = require("eol");
class AbstractReposCommand {

@@ -88,3 +88,4 @@ prepareAndMayExecute(params, rootDir) {

writeNewParentRepos(newParentRepos) {
const newParentReposContent = util_1.enforceNewline(JSON.stringify(newParentRepos, null, 2));
const jsonContent = JSON.stringify(newParentRepos, null, 2);
const newParentReposContent = this.convertLineEndings(`${jsonContent}\n`);
Global_1.Global.isVerbose() && console.log('new repo description', newParentReposContent);

@@ -95,2 +96,9 @@ fs.writeFileSync(this.parentReposConfigPath, newParentReposContent, 'utf8');

}
convertLineEndings(content) {
const isWindows = process.platform === 'win32';
if (isWindows) {
return eol.crlf(content);
}
return content;
}
}

@@ -97,0 +105,0 @@ exports.AbstractReposCommand = AbstractReposCommand;

23

dist/commands/repos/MigrateArtifactGroup.js

@@ -132,4 +132,4 @@ "use strict";

let blockStartFound = false;
let blockEndFound = false;
let bracketLevel = 0;
let blockStartIndex = 0;
const blockReplace = `${blockName}\\s*\\{`;

@@ -139,5 +139,6 @@ const blockRegex = new RegExp(blockReplace, 'g');

const line = buildFileContent[this.currentReadIndex];
if (!blockStartFound || blockEndFound) {
if (!blockStartFound) {
if (line.trim().match(blockRegex)) {
blockStartFound = true;
blockStartIndex = this.currentReadIndex;
bracketLevel++;

@@ -158,3 +159,9 @@ }

if (bracketLevel === 0) {
blockEndFound = true;
// reset, for a possible second block
blockStartFound = false;
// skip one line if there are empty lines before and after the block, so we don't end up with two empty lines
if (result.length > 0 && this.currentReadIndex < buildFileContent.length - 1 &&
result[result.length - 1].trim() === '' && buildFileContent[this.currentReadIndex + 1].trim() === '') {
this.currentReadIndex++;
}
}

@@ -167,10 +174,4 @@ }

createStringFromContentArray(content) {
let lineEnding = '\n';
const isWindows = process.platform === 'win32';
if (process.platform === 'win32') {
lineEnding = '\r\n';
}
let result = '';
content.forEach((line) => result += line + lineEnding);
return result;
const result = content.join('\n');
return this.convertLineEndings(result);
}

@@ -177,0 +178,0 @@ }

{
"name": "@cplace/cli",
"version": "0.19.20",
"version": "0.19.21",
"description": "cplace cli tools",

@@ -51,2 +51,3 @@ "main": "dist/index.js",

"cpr": "^3.0.1",
"eol-converter-cli": "^1.0.8",
"meow": "^7.0.1",

@@ -53,0 +54,0 @@ "randomatic": "^3.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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