remove cross-spawn
This commit is contained in:
parent
0bd5d289d4
commit
0367814ebe
|
@ -1,4 +1,4 @@
|
||||||
const spawn = require("cross-spawn")
|
const child_process = require("child_process")
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const { existsSync, promises: fsPromises, createWriteStream } = require("fs")
|
const { existsSync, promises: fsPromises, createWriteStream } = require("fs")
|
||||||
const yazl = require("yazl")
|
const yazl = require("yazl")
|
||||||
|
@ -121,7 +121,8 @@ switch(process.platform){
|
||||||
|
|
||||||
function awaitExec(command, args = []){
|
function awaitExec(command, args = []){
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = spawn.spawn(command, args, {
|
if(process.platform === "win32")command += ".cmd"
|
||||||
|
const child = child_process.spawn(command, args, {
|
||||||
env: process.env,
|
env: process.env,
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
stdio: "inherit"
|
stdio: "inherit"
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
const spawn = require("cross-spawn")
|
|
||||||
const { mkdirSync, existsSync } = require("fs")
|
const { mkdirSync, existsSync } = require("fs")
|
||||||
const { join, resolve } = require("path")
|
const { join, resolve } = require("path")
|
||||||
|
const child_process = require("child_process")
|
||||||
|
|
||||||
|
const spawn = (...args) => {
|
||||||
|
if(process.platform === "win32")args[0] += ".cmd"
|
||||||
|
return child_process.spawnSync(...args)
|
||||||
|
}
|
||||||
|
|
||||||
const PROJECT_DIR = resolve(__dirname, "..");
|
const PROJECT_DIR = resolve(__dirname, "..");
|
||||||
/** Main Project */
|
/** Main Project */
|
||||||
|
|
|
@ -25,14 +25,14 @@ let result;
|
||||||
spawnProcess("npm", "rm", "electron")
|
spawnProcess("npm", "rm", "electron")
|
||||||
spawnProcess("npm", "i")
|
spawnProcess("npm", "i")
|
||||||
if (process.platform === "win32"){
|
if (process.platform === "win32"){
|
||||||
result = spawnProcess("npm", "i", "--save-dev", "--arch=ia32", "electron@9.3.1")
|
result = spawnProcess("npm", "i", "--save-dev", "--arch=ia32", "electron@9")
|
||||||
} else {
|
} else {
|
||||||
result = spawnProcess("npm", "i", "--save-dev", "--arch=x64", "electron@9.3.1")
|
result = spawnProcess("npm", "i", "--save-dev", "--arch=x64", "electron@9")
|
||||||
}
|
}
|
||||||
|
|
||||||
let runString = "`npm test`"
|
let runString = "`npm test`"
|
||||||
|
|
||||||
spawnProcess("node", join(PROJECT_DIRNAME,"scripts", "installSubModules.js"))
|
spawnProcess("node", join(PROJECT_DIRNAME, "scripts", "installSubModules.js"))
|
||||||
|
|
||||||
|
|
||||||
console.log("Everything is installed. You should be able to do "+runString+" to compile everything and launch.")
|
console.log("Everything is installed. You should be able to do "+runString+" to compile everything and launch.")
|
Loading…
Reference in New Issue