Socket
Socket
Sign inDemoInstall

cspm

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cspm - npm Package Compare versions

Comparing version 0.0.33 to 0.0.34

12

build.js
function build(buildType) {
const path = require("path");
let cspJsonPath = path.join(process.cwd(), "csp");
let cspJson = require(cspJsonPath);
let cspJson = require(process.cwd() + "/csp");
switch (buildType) {

@@ -43,3 +44,6 @@

let getPackageCoordinates = require("./utilities").getPackageCoordinates;
const path = require("path");
let utilitiesPath = path.join(__dirname, "utilities");
let getPackageCoordinates = require(utilitiesPath).getPackageCoordinates;
let dependencyUrlArray = [];

@@ -112,5 +116,5 @@ for (let dependency in cspJson.dependencies) {

fs.writeFileSync(process.cwd() + "/README.md", md);
fs.writeFileSync(path.join(process.cwd(), "README.md"), md);
}
module.exports = build;

@@ -12,3 +12,4 @@ function downloadFile(user, url, destinationFolder, fileName, finishedCallback) {

let filePath = destinationFolder + fileName;
const path = require("path");
let filePath = path.join(destinationFolder, fileName);

@@ -57,3 +58,6 @@ var options = {

let downloadFolderPath = "./download." + packageCoordinates.repo + "/";
const path = require("path");
let downloadFolderPath = path.join(process.cwd(), "download." + packageCoordinates.repo);
let fs = require("fs-extra");

@@ -65,2 +69,3 @@ if (fs.existsSync(downloadFolderPath)) {

let releaseUrl = "";

@@ -92,33 +97,2 @@

function unzipPackage(packageZipPath, packageJson, callback, clean, fileName) {
let fs = require('fs-extra');
let unzip = require('unzip');
let stream = fs.createReadStream(packageZipPath).pipe(unzip.Extract({ path: "./.tmp" }));
if (!fs.existsSync("./packages")) {
fs.mkdirSync("./packages");
}
stream.on('close', function() {
callback();
if (clean === true) {
const subdirectories = require('filehound').create().path(".tmp").directory().findSync();
let mv = require('mv');
for (let i = 0; i < subdirectories.length; i++) {
let newPath = subdirectories[i].split(".")[1].split("/")[1];
mv(subdirectories[i], "./packages/" + newPath, function(err) {});
}
fs.removeSync("./.tmp");
}
});
}
function unzipFile(filePath, folderPath, finishedCallback) {

@@ -140,8 +114,8 @@

const subdirectories = require('filehound').create().path(folderPath).directory().findSync();
const path = require("path");
let newPath = path.join(folderPath, newName);
let newPath = folderPath + newName;
for (let i = 0; i < subdirectories.length; i++) {
if (subdirectories[i].includes(newPath.split("/")[2]) === true) {
if (subdirectories[i].includes(newName) === true) {
let mv = require('mv');

@@ -148,0 +122,0 @@ mv(subdirectories[i], newPath, function(err) {

@@ -11,7 +11,11 @@ function init(type) {

let askQuestion = require("./utilities").askQuestion;
const path = require("path");
let utilitiesPath = path.join(__dirname, "utilities");
let askQuestion = require(utilitiesPath).askQuestion;
if (fs.existsSync("./csp.json")) {
let cspJsonPath = path.join(process.cwd(), "csp.json");
if (fs.existsSync(cspJsonPath)) {
let response = askQuestion("csp.json exists, re-initialise?", ["yes", "no"], 1);

@@ -53,4 +57,2 @@

console.log(jsonObject);
jsonfile.writeFileSync(fileName, jsonObject);

@@ -61,2 +63,4 @@ }

const path = require("path");
console.log("Initialising Csound package:");

@@ -67,3 +71,4 @@

let jsonObject = {};
let nameSuggestion = process.cwd().split("/").slice(-1)[0];
let nameSuggestion = process.cwd().split(path.sep).slice(-1)[0];
jsonObject.name = readlineSync.question('Package name: (' + nameSuggestion + ')\n> ');

@@ -100,5 +105,7 @@ jsonObject.name = jsonObject.name === "" ? nameSuggestion : jsonObject.name;

let createEntrypoint = "";
let nameSuggestion = process.cwd().split("/").slice(-1)[0].split(".")[0] + ".udo";
let nameSuggestion = process.cwd().split(path.sep).slice(-1)[0].split(".")[0] + ".udo";
let suggestedFileExists = fs.existsSync("./" + nameSuggestion);
const path = require("path");
let nameSuggestionPath = path.join(process.cwd(), nameSuggestion);
let suggestedFileExists = fs.existsSync(nameSuggestionPath);

@@ -247,6 +254,9 @@ while(createEntrypoint.localeCompare("no") !== 0 && createEntrypoint.localeCompare("yes") !== 0) {

let nameEntrypoint = "";
let nameSuggestion = process.cwd().split("/").slice(-1)[0].split(".")[0];
const path = require("path");
let nameSuggestion = process.cwd().split(path.sep).slice(-1)[0].split(".")[0];
let suggestedFileName = nameSuggestion + ".csd";
let suggestedFileExists = fs.existsSync(process.cwd() + "/" + suggestedFileName);
let suggestedFileNamePath = path.join(process.cwd(), suggestedFileName);
let suggestedFileExists = fs.existsSync(suggestedFileNamePath);

@@ -278,3 +288,4 @@ while(nameEntrypoint.localeCompare("no") !== 0 && nameEntrypoint.localeCompare("yes") !== 0) {

entrypointFileName = readlineSync.question("Entrypoint file name:\n> ");
fileExists = fs.existsSync("./" + entrypointFileName);
let entrypointFileNamePath = path.join(process.cwd(), entrypointFileName);
fileExists = fs.existsSync(entrypointFileNamePath);

@@ -285,7 +296,3 @@ if (fileExists === false) {

}
else {
entrypointFileName = "./" + entrypointFileName;
}
} while (fileExists === false);

@@ -304,3 +311,5 @@ }

let uniqueArray = require("./utilities").uniqueArray;
let utilitiesPath = path.join(process.cwd(), "utilities");
let uniqueArray = require(utilitiesPath).uniqueArray;
let macros = uniqueArray(result);

@@ -307,0 +316,0 @@ macros = macros.map(y => { return y.substr(1)});

@@ -69,11 +69,15 @@ function getPackageCoordinates(string) {

let downloadAndUnzipFile = require("./download").downloadAndUnzipFile;
const path = require("path");
let downloadPath = path.join(__dirname, "download");
let downloadAndUnzipFile = require(downloadPath).downloadAndUnzipFile;
downloadAndUnzipFile(packageCoordinates, function(downloadFolderPath) {
let cspJsonPath = process.cwd() + "/" + downloadFolderPath + packageCoordinates.repo + "/csp.json";
let cspJsonPath = path.join(downloadFolderPath, packageCoordinates.repo, "csp.json");
let cspJson = require(cspJsonPath);
let globalPackagePath = require("./utilities").getGlobalPackagePath();
let destinationFolder = globalPackagePath + "/" + packageCoordinates.repo;
let destinationPath = destinationFolder + "/Versions/" + cspJson.version;
let utilitiesPath = path.join(__dirname, "utilities");
let globalPackagePath = require(utilitiesPath).getGlobalPackagePath();
let destinationFolder = path.join(globalPackagePath, packageCoordinates.repo);
let destinationPath = path.join(destinationFolder, "Versions", cspJson.version);
let fs = require("fs-extra");

@@ -114,4 +118,5 @@

let fs = require("fs-extra");
const path = require("path");
let destinationPath = destinationFolder + "/Versions/" + cspJson.version;
let destinationPath = path.join(destinationFolder, "Versions", cspJson.version);
fs.ensureDirSync(destinationPath);

@@ -128,3 +133,4 @@

fs.removeSync("./download." + packageName);
let downloadPath = path.join(__dirname, "download." + packageName);
fs.removeSync(downloadPath);
let isWin = /^win/.test(process.platform);

@@ -134,4 +140,4 @@

let destination = destinationFolder + "/" + filePath;
let source = destinationPath + "/" + filePath;
let destination = path.join(destinationFolder, filePath);
let source = path.join(destinationPath, filePath);

@@ -138,0 +144,0 @@ if (fs.existsSync(destination)) {

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

let isWin = /^win/.test(process.platform);
const path = require("path");

@@ -19,4 +20,4 @@ switch (option) {

let install = require("./install").install;
let installPath = path.join(__dirname, "install");
let install = require(installPath).install;
let result = install(process.argv);

@@ -28,3 +29,4 @@ return result;

let init = require('./init').init;
let initPath = path.join(__dirname, "init");
let init = require(initPath).init;
let type = process.argv[3];

@@ -53,3 +55,4 @@

let link = require("./link");
let linkPath = path.join(__dirname, "link");
let link = require(linkPath);
let packageName = process.argv[3];

@@ -74,3 +77,5 @@ link(packageName);

let run = require("./run");
let runPath = path.join(__dirname, "run");
let run = require(runPath);
let packageName = process.argv[3];

@@ -85,3 +90,4 @@ run(packageName, process.argv);

let build = require("./build");
let buildPath = path.join(__dirname, "build");
let build = require(buildPath);
let buildType = process.argv[3];

@@ -88,0 +94,0 @@ build(buildType);

{
"name": "cspm",
"version": "0.0.33",
"version": "0.0.34",
"description": "Package management and build tool for the Csound language",

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

@@ -0,1 +1,2 @@

//TODO: Fix forward slash only paths here

@@ -2,0 +3,0 @@ function run(csdPackageName, argv) {

@@ -103,3 +103,2 @@ function getGlobalPackagePath() {

console.log(currentString);
if (array[i] !== currentString) {

@@ -123,4 +122,4 @@

const fs = require("fs");
const path = require("path");
for (let i = 0; i < subdirectories.length; i++) {

@@ -130,3 +129,4 @@

let cspJson = require(fs.realpathSync(subdirectories[i] + "/csp.json"));
let cspJsonPath = path.join(subdirectories[i], "csp.json");
let cspJson = require(currentPath));
installedPackages.push(cspJson.name);

@@ -133,0 +133,0 @@ }

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