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

commonplace

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonplace - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

src/.commonplace

12

lib/commonplace.js

@@ -156,8 +156,8 @@ var fs = require('fs');

function update_file(file) {
fs.readFile(file, function(err, data) {
fs.writeFile(file.replace(commonplace_src, local_src), data, function(err) {
if (err) {
console.error('Error updating ' + file, err);
}
});
var destination = file.replace(commonplace_src, local_src);
utils.copyFile(file, destination, function(err) {
if (err) {
console.error('Error updating ' + destination)
console.error(err);
}
});

@@ -164,0 +164,0 @@ }

@@ -91,2 +91,29 @@ var fs = require('fs');

var createDir = module.exports.createDir = function(dir, callback) {
var parent = path.dirname(dir);
fs.exists(parent, function(exists) {
function doMake() {
if (fs.existsSync(dir)) {
callback();
return;
}
fs.mkdir(dir, function(err) {
callback(err);
});
}
if (exists) {
doMake();
} else {
createDir(parent, function(err) {
if (err) {
callback(err);
return;
}
doMake();
});
}
});
};
module.exports.copyFile = function(src, dest, callback) {

@@ -98,9 +125,17 @@ fs.exists(src, function(exists) {

}
fs.readFile(src, function(err, data) {
createDir(path.dirname(dest), function(err) {
if (err) {
if (callback) callback(err);
console.error('Unable to create directory for ' + dest);
console.error(err);
return;
}
fs.writeFile(dest, data, function(err) {
if (callback) callback(err);
fs.readFile(src, function(err, data) {
if (err) {
if (callback) callback(err);
return;
}
fs.writeFile(dest, data, function(err) {
if (callback) callback(err);
});
});

@@ -107,0 +142,0 @@ });

{
"name": "commonplace",
"version": "0.1.6",
"version": "0.1.7",
"repository": {

@@ -5,0 +5,0 @@ "url": "git://github.com/mozilla/commonplace.git",

Sorry, the diff of this file is not supported yet

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