summaryrefslogtreecommitdiff
path: root/scripts/winpy3fix.js
blob: 14d8f1363dbf6fc998da2a2a36a567f5bbc2cea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * mongo-edu
 *
 * Copyright (c) 2014 Przemyslaw Pluta
 * Licensed under the MIT license.
 * https://github.com/przemyslawpluta/mongo-edu/blob/master/LICENSE
 */

var mv = require('mv'),
    fs = require('fs'),
    path = require('path');

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');
        });
    });
}