@celo/celo-composer
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -7,2 +7,3 @@ const inquirer = require("inquirer"); | ||
const { ensureDir, readdir } = require("fs-extra"); | ||
const Os = require("os"); | ||
@@ -183,11 +184,28 @@ const BASE_URL = "https://github.com/celo-org/celo-composer/"; | ||
*/ | ||
let packagesStdOut; | ||
if(isWindows) { | ||
let { stdout } = shell.exec("dir packages /b", { | ||
silent: true, | ||
}); | ||
packagesStdOut = stdout; | ||
} else { | ||
let { stdout } = shell.exec("echo packages/*/", { | ||
silent: true, | ||
}); | ||
packagesStdOut = stdout; | ||
} | ||
let { stdout: packagesStdOut } = shell.exec("echo packages/*/", { | ||
silent: true, | ||
}); | ||
/** | ||
* Node 14 and below doens't support replaceAll | ||
*/ | ||
let packages = packagesStdOut | ||
let packages; | ||
if(isWindows) { | ||
packages = packagesStdOut.replaceAll("\n", " ").replaceAll("\r", "").split(" "); | ||
// remove empty strings from array | ||
packages = packages.filter(function (el) { | ||
return el != null && el != ""; | ||
}); | ||
} else { | ||
// remove new line from packagesStdOut | ||
packages = packagesStdOut | ||
.replace(/packages\//g, "") | ||
@@ -197,3 +215,4 @@ .replace(/\//g, "") | ||
.split(" "); | ||
} | ||
/** | ||
@@ -333,4 +352,8 @@ * For every package selected by user, | ||
function isWindows() { | ||
return Os.platform() === 'win32' | ||
} | ||
module.exports = { | ||
createAsync, | ||
}; | ||
}; |
{ | ||
"name": "@celo/celo-composer", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Get started building dApps on Celo", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22805
354