Use system tmp, to prevent files from accumulating in the local directory

This commit is contained in:
mmcwilliams 2017-10-11 20:06:27 -04:00
parent 20930513f9
commit 5cdd191f35
1 changed files with 11 additions and 11 deletions

22
v2f.js
View File

@ -3,7 +3,7 @@
'use strict' 'use strict'
const exec = require('child_process').exec const exec = require('child_process').exec
const fs = require('fs') const fs = require('fs')
const _tmp = './temp' const _tmp = '/tmp'
//var frame_height = 7.61 //var frame_height = 7.61
//var frame_height = 7.49 //var frame_height = 7.49
@ -88,7 +88,7 @@ function stitch (loc, dim) {
}) })
}, 1000) }, 1000)
} }
}; }
for (let i = 0; i < frames.length; i++) { for (let i = 0; i < frames.length; i++) {
execStr += frames[i] + ' ' execStr += frames[i] + ' '
if ((i + 1) % (width * length) === 0 || i === frames.length - 1) { if ((i + 1) % (width * length) === 0 || i === frames.length - 1) {
@ -105,7 +105,7 @@ function stitch (loc, dim) {
console.log('Stitching frames into sheets...') console.log('Stitching frames into sheets...')
console.log(`Sheets will contain ${width}x${length} frames...`) console.log(`Sheets will contain ${width}x${length} frames...`)
exec(cmd, find_cb) exec(cmd, find_cb)
}; }
var errorHandle = function (err) { var errorHandle = function (err) {
if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--verbose') !== -1){ if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--verbose') !== -1){
@ -116,22 +116,22 @@ var errorHandle = function (err) {
process.exit(1) process.exit(1)
}; };
process.on('uncaughtException', function (err) { process.on('uncaughtException', err => {
errorHandle(err); errorHandle(err)
}); })
if (typeof process.argv[2] === 'undefined') { if (typeof process.argv[2] === 'undefined') {
console.error('No path to video defined'); console.error('No path to video defined')
process.exit(1); process.exit(1)
} }
if (typeof process.argv[3] === 'undefined') { if (typeof process.argv[3] === 'undefined') {
process.argv[3] = 300; process.argv[3] = 300
console.log('Using default 300dpi'); console.log('Using default 300dpi')
} }
convert(process.argv[2], process.argv[3]); convert(process.argv[2], process.argv[3])
/* /*