Permalink
Browse files

Throw error if destination does not exist

  • Loading branch information...
1 parent fec2f1b commit a0564787db0becbd62bbec275fdbf77188b9ccb9 @hacksparrow committed Feb 25, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 index.js
  2. +1 −1 package.json
View
@@ -5,7 +5,7 @@ var program = require('commander');
var exec = require('child_process').exec;
program
- .version('0.0.1')
+ .version('0.0.2')
.option('-f, --file <path>', 'FLV file path')
.option('-o, --out [path]', 'Output directory')
.parse(process.argv);
@@ -23,7 +23,7 @@ function convert(source_file, destination_dir) {
in_destination_dir = true;
process.chdir(destination_dir);
}
- catch (err) { console.log(err); }
+ catch (err) { throw err; }
}
var destination_file = source_file.split('/').slice(-1)[0].replace('.flv', '.mp3');
var ffmpeg = 'ffmpeg -y -i '+ source_file +' -f mp3 -vn -acodec copy ' + destination_file;
View
@@ -1,6 +1,6 @@
{
"name": "flv2mp3",
- "version": "0.0.1",
+ "version": "0.0.2",
"description": "Node.js module to convert FLV to MP3 files",
"preferGlobal": "true",
"main": "index.js",

0 comments on commit a056478

Please sign in to comment.