UNPKG

1.32 kBJavaScriptView Raw
1var fs = require('fs');
2var Rx = require('rx');
3var exec = Rx.Observable.fromNodeCallback(require('child_process').exec);
4var writeFile = Rx.Observable.fromNodeCallback(fs.writeFile);
5var pkg = require(__dirname + '/../package.json');
6
7pkg.name = '@cycle/rx-run';
8var root = __dirname + '/..';
9
10Rx.Observable.of(null)
11 .flatMap(exec('mkdir -p ' + root + '/rx-run'))
12 .flatMap(exec('mkdir -p ' + root + '/rx-run/dist'))
13 .flatMap(exec('mkdir -p ' + root + '/rx-run/docs'))
14 .flatMap(exec('mkdir -p ' + root + '/rx-run/lib'))
15 .flatMap(exec('mkdir -p ' + root + '/rx-run/src'))
16 .flatMap(exec('mkdir -p ' + root + '/rx-run/test'))
17 .flatMap(exec('cp ' + root + '/.* ' + root + '/rx-run 2>/dev/null || :'))
18 .flatMap(exec('cp ' + root + '/* ' + root + '/rx-run 2>/dev/null || :'))
19 .flatMap(exec('cp -r ' + root + '/dist ' + root + '/rx-run/'))
20 .flatMap(exec('cp -r ' + root + '/docs ' + root + '/rx-run/'))
21 .flatMap(exec('cp -r ' + root + '/lib ' + root + '/rx-run/'))
22 .flatMap(exec('cp -r ' + root + '/src ' + root + '/rx-run/'))
23 .flatMap(exec('cp -r ' + root + '/test ' + root + '/rx-run/'))
24 .flatMap(writeFile(
25 root + '/rx-run/package.json',
26 JSON.stringify(pkg, null, ' '),
27 'utf8'
28 ))
29 .flatMap(exec('cd ' + root + '/rx-run && npm install && npm publish --access=public'))
30 .subscribe();