summaryrefslogtreecommitdiff
path: root/scripts/winpy3fix.js
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2014-04-08 22:18:53 +0100
committerprzemyslawpluta <przemekpluta@hotmail.com>2014-04-08 22:18:53 +0100
commit8877218526142e068ee98c866b74aea528d66dc0 (patch)
tree0abbaf039b6e552fc7fb0577c2239cf00eec12f1 /scripts/winpy3fix.js
parent49a1be038940f2b0a6359015bf30d35846306bec (diff)
downloadmongo-edu-8877218526142e068ee98c866b74aea528d66dc0.zip
win specific
Diffstat (limited to 'scripts/winpy3fix.js')
-rw-r--r--scripts/winpy3fix.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/winpy3fix.js b/scripts/winpy3fix.js
index a597ba3..9dfcd07 100644
--- a/scripts/winpy3fix.js
+++ b/scripts/winpy3fix.js
@@ -1,15 +1,18 @@
var mv = require('mv'),
- fs = require('fs'),
+ fs = require('fs'),
path = require('path');
-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) { console.log(err); }
- });
-});
+var isWin = /^win/.test(process.platform);
+if (isWin) {
+ 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) { console.log(err); }
+ console.log('win py3.x fix');
+ });
+ });
+} \ No newline at end of file