summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/winpy3fix.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/winpy3fix.js b/scripts/winpy3fix.js
index 345013e..d5facd0 100644
--- a/scripts/winpy3fix.js
+++ b/scripts/winpy3fix.js
@@ -1,7 +1,15 @@
var mv = require('mv'),
+ fs = require('fs'),
path = require('path');
-mv(path.resolve(__dirname + '../' + '../.temp/youtube-dl.js'), path.resolve(__dirname + '../' + '../node_modules/youtube-dl/lib/youtube-dl.js'), function error(err) {
- 'use strict';
- if (err !== null) { console.log(err); }
+var target = path.resolve(__dirname + '../' + '../node_modules/youtube-dl/lib/youtube-dl.js');
+
+fs.unlink(target, function (err) {
+ 'use strict';
+ if (err !== null) { return console.log(err.stack); }
+ mv(path.resolve(__dirname + '../' + '../.temp/youtube-dl.js'), target, function error(err) {
+ if (err !== null) { console.log(err); }
+ });
});
+
+