-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use node instead of bash for sdk link so it works on windows as well.
- Loading branch information
James Thomas
committed
Dec 18, 2017
1 parent
48fddfb
commit 541e0a8
Showing
5 changed files
with
3 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,7 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const fse = require('fs-extra'); | ||
const child_process = require('child_process'); | ||
const localSdk = require(path.join(process.env.BB_SDK_SRC_DIR, 'bespoke-gulp-tasks', 'helpers', 'local_sdk.js')); | ||
const localSDK = require(path.join(process.env.BB_SDK_SRC_DIR, 'bespoke-gulp-tasks', 'helpers', 'local_sdk.js')); | ||
const projectRootPath = path.join(__dirname, '..'); | ||
|
||
// check / empty tmp | ||
console.log('Preparing tmp dir'); | ||
if (fse.existsSync('tmp')) { | ||
fse.emptyDirSync('tmp'); | ||
} else { | ||
fse.ensureDirSync('tmp'); | ||
} | ||
|
||
console.log('Preparing node_modules'); | ||
if (fse.existsSync('node_modules')) { | ||
fse.removeSync('node_modules/bookingbug-angular'); | ||
fse.moveSync('node_modules', 'tmp/node_modules'); | ||
} | ||
|
||
console.log('Local sdk prepare'); | ||
localSdk.prepare(projectRootPath); | ||
|
||
console.log('Change dir to tmp'); | ||
process.chdir('tmp'); | ||
|
||
console.log('Exec npm install'); | ||
child_process.exec('npm install --global-style --no-package-lock', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
process.exit(1); | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
console.log(`stderr: ${stderr}`); | ||
|
||
console.log('Change dir ..'); | ||
process.chdir('..'); | ||
|
||
console.log('Put node_modules back'); | ||
fse.moveSync('tmp/node_modules', 'node_modules'); | ||
|
||
console.log('Local sdk symlink'); | ||
localSdk.symlink(projectRootPath); | ||
}); | ||
localSDK.link(projectRootPath); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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