Comparing version 1.2.1 to 1.2.2
18
index.js
@@ -25,7 +25,7 @@ #!/usr/bin/env node | ||
for (var i in files) { | ||
var lines = fs.readFileSync(files[i], 'utf-8').split('\n') | ||
files.forEach(function(file) { | ||
var lines = fs.readFileSync(file, 'utf-8').split('\n') | ||
if (!lines.length) { | ||
console.log('Unable to extract instrument name for file', files[i]) | ||
console.log('Unable to extract instrument name for file', file) | ||
return | ||
@@ -36,3 +36,3 @@ } | ||
var p = path.dirname(files[i]) + '/' + 'event.json' | ||
var p = path.dirname(file) + '/' + 'event.json' | ||
var _event = JSON.parse(fs.readFileSync(p, 'utf-8')) | ||
@@ -44,4 +44,4 @@ var key = _event.value.frame.testData.metadata.find(function(r) { return r.key === '!instrument.serial'}) | ||
var pieces = path.basename(files[i]).split('.txt')[0].split(' ') | ||
var pieces = path.basename(file, '.txt').split(' ') | ||
console.log(path.basename(file, '.txt')) | ||
var yyyy = pieces[1].substring(4,8) | ||
@@ -51,6 +51,6 @@ var dd = pieces[1].substring(0,2) | ||
var name = instrumentName + '-' + yyyy + mm + dd + '-' + pieces[2] + '-' + pieces[0] + uuid() + '.txt' | ||
var name = instrumentName + '-' + yyyy + mm + dd + '-' + pieces[2] + '-' + pieces[0] + '.txt' | ||
var writeStream = fs.createWriteStream(destination + '/' + name) | ||
fs.createReadStream(files[i]).pipe(writeStream) | ||
fs.createReadStream(file).pipe(writeStream) | ||
@@ -60,4 +60,4 @@ writeStream.on('finish', function() { | ||
}) | ||
} | ||
}) | ||
}) | ||
}) |
{ | ||
"name": "flat-spe", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
43300517
102
46