New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-lode

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

node-lode - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

55

cli.js

@@ -118,5 +118,6 @@ #!/usr/bin/env node

function getDirFiles(directory, callback) {
fs.readdirSync(directory, function(err, files) {
files.forEach(function(file) {
fs.statSync(directory + "/" + file, function(err, stats) {
fs.readdir(directory, function(err, files) {
for (let i = 0; i < files.length; i++) {
let file = files[i];
fs.stat(directory + "/" + file, function(err, stats) {
if (stats.isFile()) {

@@ -129,10 +130,13 @@ callback(directory + "/" + file);

});
});
}
});
}
getDirFiles(".", function(file_with_path) {
getDirFiles(`${args[2]}`, file_with_path => {
// console.log(`file_with_path: ${file_with_path}`);
const sourcePath = path.resolve(args[2], file_with_path);
const destPath = path.resolve(args[3], file_with_path);
handleCopy(ignoreList, sourcePath, destPath, false);
// console.log(`Copying over ${sourcePath}`);
// console.log(`Copying over ${destPath}`);
handleCopy(ignoreList, sourcePath, destPath);
});

@@ -146,6 +150,6 @@

if (type !== "rename") {
handleCopy(ignoreList, sourcePath, destPath);
handleCopy(ignoreList, sourcePath, destPath, true);
} else if (fs.existsSync(sourcePath)) {
// File has been changed to this
handleCopy(ignoreList, sourcePath, destPath);
handleCopy(ignoreList, sourcePath, destPath, true);
} else if (fs.existsSync(destPath)) {

@@ -158,6 +162,7 @@ // File has been deleted

function handleCopy(ignoreList, sourcePath, destPath, debug = true) {
function handleCopy(ignoreList, sourcePath, destPath, debug = false) {
try {
for (let i = 0; i < ignoreList.length; i++) {
if (sourcePath.includes(ignoreList[i])) {
console.log(`Not copying ${sourcePath}`);
return;

@@ -243,10 +248,3 @@ }

if (!fs.existsSync(getIgnorePath())) {
const ignoreList = [".idea", "tmp", "jb_", "_old_", "node_modules"];
let str = "";
for (let i = 0; i < ignoreList.length; i++) {
if (ignoreList[i] !== "") {
str += ignoreList[i] + "\n";
}
}
fs.outputFile(getIgnorePath(), str);
createNewIgnore();
}

@@ -264,6 +262,25 @@ const contents = fs

if (resultIsYes(result)) {
remove();
createNewIgnore();
}
return {};
return [];
}
}
function createNewIgnore() {
const ignoreList = [
".idea",
"tmp",
"jb_",
"_old_",
"node_modules",
"build",
"generated",
];
let str = "";
for (let i = 0; i < ignoreList.length; i++) {
if (ignoreList[i] !== "") {
str += ignoreList[i] + "\n";
}
}
fs.outputFile(getIgnorePath(), str);
}
{
"name": "node-lode",
"version": "1.0.9",
"version": "1.0.10",
"preferGlobal": true,

@@ -5,0 +5,0 @@ "bin": {

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