-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from jvmn/feature/2.0.0-rc1
Feature/2.0.0 rc1
- Loading branch information
Showing
16 changed files
with
4,130 additions
and
3,736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
|
||
const { spawn } = require('child_process') | ||
const minimist = require('minimist') | ||
const args = minimist(process.argv.slice(2)) | ||
const fs = require('fs') | ||
const error = require('../lib/error') | ||
// expose project root folder varialbe to load configs in npm | ||
process.env.PROJECT_CWD = process.env.PWD | ||
|
||
// check if we have a webpack.dev config in project root | ||
try { | ||
fs.accessSync(`${ process.env.PROJECT_CWD }/webpack.dev.js`, fs.constants.R_OK | fs.constants.W_OK) | ||
process.env.WEBPACK_DEV_CONFIG = `${process.env.PROJECT_CWD}/webpack.dev.js` | ||
console.log('-> using webpack.dev project config!') | ||
} catch (err) { | ||
console.log('-> using webpack.dev package config!') | ||
process.env.WEBPACK_DEV_CONFIG = `./webpack.dev.js` | ||
} | ||
// check if we have a svg-sprite config in project root | ||
try { | ||
fs.accessSync(`${ process.env.PROJECT_CWD }/svg-sprite.config.json`, fs.constants.R_OK | fs.constants.W_OK) | ||
process.env.SPRITE_CONFIG = `${process.env.PROJECT_CWD}/svg-sprite.config.json` | ||
console.log('-> using svg-sprite.config project config!') | ||
} catch (err) { | ||
console.log('-> using svg-sprite.config package config!') | ||
process.env.SPRITE_CONFIG = `./svg-sprite.config.json` | ||
} | ||
|
||
let options = '' | ||
if (args.all) { | ||
options = ':all' | ||
} else if (args.stage) { | ||
options = ':stage' | ||
} | ||
if (args.feature) { | ||
options = ':feature' + options | ||
} | ||
|
||
const child = spawn(`npm explore @jvmn/groundzero-taskrunner-webpack -- npm run rsync${options}`, { | ||
stdio: 'inherit', | ||
env: process.env, | ||
shell: true | ||
}) | ||
|
||
child.on('error', err => { | ||
error(`CLI Rsync -> ${err}`, true) | ||
}) | ||
|
||
if (child.stdin) { | ||
process.stdin.pipe(child.stdin) | ||
} | ||
|
||
if (child.stdout) { | ||
child.stdout.on('data', (data) => { | ||
console.log(`child stdout:\n${data}`) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.