node-addon-api
Advanced tools
Comparing version 0.5.1 to 0.6.2
@@ -34,3 +34,3 @@ { | ||
}, | ||
"version": "0.5.1" | ||
"version": "0.6.2" | ||
} |
const fs = require('fs'); | ||
const path = require('path'); | ||
@@ -225,4 +226,4 @@ const args = process.argv.slice(2); | ||
var paths = listFiles(dir); | ||
paths.forEach(function(path) { | ||
var filename = path.split('\\').pop().split('/').pop(); | ||
paths.forEach(function(dirEntry) { | ||
var filename = dirEntry.split('\\').pop().split('/').pop(); | ||
@@ -233,5 +234,5 @@ // Check whether the file is a source file or a config file | ||
if (sourcePattern.test(filename)) { | ||
convertFile(path, SourceFileOperations); | ||
convertFile(dirEntry, SourceFileOperations); | ||
} else if (ConfigFileOperations[filename] != null) { | ||
convertFile(path, ConfigFileOperations[filename]); | ||
convertFile(dirEntry, ConfigFileOperations[filename]); | ||
} | ||
@@ -241,3 +242,2 @@ }); | ||
function listFiles(dir, filelist) { | ||
var path = path || require('path'); | ||
files = fs.readdirSync(dir); | ||
@@ -263,4 +263,4 @@ filelist = filelist || []; | ||
function convertFile(path, operations) { | ||
fs.readFile(path, "utf-8", function (err, file) { | ||
function convertFile(fileName, operations) { | ||
fs.readFile(fileName, "utf-8", function (err, file) { | ||
if (err) throw err; | ||
@@ -270,3 +270,3 @@ | ||
fs.writeFile(path, file, function(err){ | ||
fs.writeFile(fileName, file, function(err){ | ||
if (err) throw err; | ||
@@ -273,0 +273,0 @@ }); |
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
Sorry, the diff of this file is not supported yet
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
420500