mirror of https://github.com/embarklabs/embark.git
build: fix win compat for collective build and embark-solo cli
This commit is contained in:
parent
7ea9aa417d
commit
3f4ce3b549
|
@ -3,7 +3,7 @@
|
||||||
const cloneDeep = require('lodash.clonedeep');
|
const cloneDeep = require('lodash.clonedeep');
|
||||||
const {copySync, ensureDirSync} = require('fs-extra');
|
const {copySync, ensureDirSync} = require('fs-extra');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const {dirname, join, relative} = require('path');
|
const {dirname, join, normalize, relative, sep} = require('path');
|
||||||
|
|
||||||
// @babel/cli v7's --copy-files option does not work well together with
|
// @babel/cli v7's --copy-files option does not work well together with
|
||||||
// config-specified ignore paths, and that's a problem for embark-collective
|
// config-specified ignore paths, and that's a problem for embark-collective
|
||||||
|
@ -27,9 +27,9 @@ function copyFiles (ignored) {
|
||||||
]}
|
]}
|
||||||
).map(path => relative(__dirname, path));
|
).map(path => relative(__dirname, path));
|
||||||
|
|
||||||
ignored = ignored.concat(others);
|
ignored = ignored.concat(others).map(normalize);
|
||||||
ignored
|
ignored
|
||||||
.map(path => path.replace('src/', 'dist/'))
|
.map(path => path.replace(`src${sep}`, `dist${sep}`))
|
||||||
.forEach((dest, index) => {
|
.forEach((dest, index) => {
|
||||||
ensureDirSync(dirname(join(__dirname, dest)));
|
ensureDirSync(dirname(join(__dirname, dest)));
|
||||||
const source = ignored[index];
|
const source = ignored[index];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
const cloneDeep = require('lodash.clonedeep');
|
const cloneDeep = require('lodash.clonedeep');
|
||||||
const {copySync, ensureDirSync} = require('fs-extra');
|
const {copySync, ensureDirSync} = require('fs-extra');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const {dirname, join, relative} = require('path');
|
const {dirname, join, normalize, relative, sep} = require('path');
|
||||||
|
|
||||||
// @babel/cli v7's --copy-files option does not work well together with
|
// @babel/cli v7's --copy-files option does not work well together with
|
||||||
// config-specified ignore paths, and that's a problem for embark-collective
|
// config-specified ignore paths, and that's a problem for embark-collective
|
||||||
|
@ -25,9 +25,9 @@ function copyFiles (ignored) {
|
||||||
]}
|
]}
|
||||||
).map(path => relative(__dirname, path));
|
).map(path => relative(__dirname, path));
|
||||||
|
|
||||||
ignored = ignored.concat(others);
|
ignored = ignored.concat(others).map(normalize);
|
||||||
ignored
|
ignored
|
||||||
.map(path => path.replace('src/', 'dist/'))
|
.map(path => path.replace(`src${sep}`, `dist${sep}`))
|
||||||
.forEach((dest, index) => {
|
.forEach((dest, index) => {
|
||||||
ensureDirSync(dirname(join(__dirname, dest)));
|
ensureDirSync(dirname(join(__dirname, dest)));
|
||||||
const source = ignored[index];
|
const source = ignored[index];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
const cloneDeep = require('lodash.clonedeep');
|
const cloneDeep = require('lodash.clonedeep');
|
||||||
const {copySync, ensureDirSync} = require('fs-extra');
|
const {copySync, ensureDirSync} = require('fs-extra');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const {dirname, join, relative} = require('path');
|
const {dirname, join, normalize, relative, sep} = require('path');
|
||||||
|
|
||||||
// @babel/cli v7's --copy-files option does not work well together with
|
// @babel/cli v7's --copy-files option does not work well together with
|
||||||
// config-specified ignore paths, and that's a problem for embark-collective
|
// config-specified ignore paths, and that's a problem for embark-collective
|
||||||
|
@ -25,9 +25,9 @@ function copyFiles (ignored) {
|
||||||
]}
|
]}
|
||||||
).map(path => relative(__dirname, path));
|
).map(path => relative(__dirname, path));
|
||||||
|
|
||||||
ignored = ignored.concat(others);
|
ignored = ignored.concat(others).map(normalize);
|
||||||
ignored
|
ignored
|
||||||
.map(path => path.replace('src/', 'dist/'))
|
.map(path => path.replace(`src${sep}`, `dist${sep}`))
|
||||||
.forEach((dest, index) => {
|
.forEach((dest, index) => {
|
||||||
ensureDirSync(dirname(join(__dirname, dest)));
|
ensureDirSync(dirname(join(__dirname, dest)));
|
||||||
const source = ignored[index];
|
const source = ignored[index];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
const cloneDeep = require('lodash.clonedeep');
|
const cloneDeep = require('lodash.clonedeep');
|
||||||
const {copySync, ensureDirSync} = require('fs-extra');
|
const {copySync, ensureDirSync} = require('fs-extra');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const {dirname, join, relative} = require('path');
|
const {dirname, join, normalize, relative, sep} = require('path');
|
||||||
|
|
||||||
// @babel/cli v7's --copy-files option does not work well together with
|
// @babel/cli v7's --copy-files option does not work well together with
|
||||||
// config-specified ignore paths, and that's a problem for embark-collective
|
// config-specified ignore paths, and that's a problem for embark-collective
|
||||||
|
@ -25,9 +25,9 @@ function copyFiles (ignored) {
|
||||||
]}
|
]}
|
||||||
).map(path => relative(__dirname, path));
|
).map(path => relative(__dirname, path));
|
||||||
|
|
||||||
ignored = ignored.concat(others);
|
ignored = ignored.concat(others).map(normalize);
|
||||||
ignored
|
ignored
|
||||||
.map(path => path.replace('src/', 'dist/'))
|
.map(path => path.replace(`src${sep}`, `dist${sep}`))
|
||||||
.forEach((dest, index) => {
|
.forEach((dest, index) => {
|
||||||
ensureDirSync(dirname(join(__dirname, dest)));
|
ensureDirSync(dirname(join(__dirname, dest)));
|
||||||
const source = ignored[index];
|
const source = ignored[index];
|
||||||
|
|
|
@ -24,6 +24,7 @@ module.exports = function (cliArgs) {
|
||||||
join(embarkCollectivePath, 'package.json')
|
join(embarkCollectivePath, 'package.json')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const npxCmd = process.platform === 'win32' ? 'npx.cmd': 'npx';
|
||||||
process.chdir(embarkCollectivePath);
|
process.chdir(embarkCollectivePath);
|
||||||
spawn('npm', ['run', '--', ...cliArgs], {stdio: 'inherit'});
|
spawn(npxCmd, ['run', '--', ...cliArgs], {stdio: 'inherit'});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue