File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ node_modules
22npm-debug.log
33.DS_Store
44.idea /
5+ dist /
56build /
67dev /
Original file line number Diff line number Diff line change 1+ /**
2+ * Runs an ordered set of commands within each of the build directories.
3+ */
4+
5+ import fs from 'fs' ;
6+ import path from 'path' ;
7+ import { spawnSync } from 'child_process' ;
8+
9+ var exampleDirs = fs . readdirSync ( __dirname ) . filter ( ( file ) => {
10+ return fs . statSync ( path . join ( __dirname , file ) ) . isDirectory ( ) ;
11+ } ) ;
12+
13+ // Ordering is important here. `npm install` must come first.
14+ var cmdArgs = [
15+ { cmd : 'npm' , args : [ 'install' ] } ,
16+ { cmd : 'webpack' , args : [ 'index.js' ] }
17+ ] ;
18+
19+ for ( const dir of exampleDirs ) {
20+ for ( const cmdArg of cmdArgs ) {
21+ // declare opts in this scope to avoid https://github.com/joyent/node/issues/9158
22+ const opts = {
23+ cwd : path . join ( __dirname , dir ) ,
24+ stdio : 'inherit'
25+ } ;
26+ let result = { } ;
27+ if ( process . platform === 'win32' ) {
28+ result = spawnSync ( cmdArg . cmd + '.cmd' , cmdArg . args , opts ) ;
29+ } else {
30+ result = spawnSync ( cmdArg . cmd , cmdArg . args , opts ) ;
31+ }
32+ if ( result . status !== 0 ) {
33+ throw new Error ( 'Building examples exited with non-zero' ) ;
34+ }
35+ }
36+ }
Original file line number Diff line number Diff line change 66 "start" : " gulp" ,
77 "build:extension" : " BABEL_ENV=production gulp build:extension" ,
88 "build:firefox" : " BABEL_ENV=production gulp build:firefox" ,
9+ "build:examples" : " babel-node examples/buildAll.js" ,
910 "compress:extension" : " npm run build:extension && gulp compress:extension" ,
1011 "compress:firefox" : " npm run build:firefox && gulp compress:firefox" ,
1112 "clean" : " rm -rf build/ && rm -rf dev/" ,
Original file line number Diff line number Diff line change 11{
2- "version" : " 0.1.0 " ,
2+ "version" : " 0.1.9 " ,
33 "name" : " Redux DevTools" ,
44 "short_name" : " Redux DevTools" ,
55 "description" : " DevTools for Redux with actions history, undo and replay." ,
You can’t perform that action at this time.
0 commit comments