17 lines
434 B
JavaScript
17 lines
434 B
JavaScript
const { spawn } = require("child_process");
|
|
|
|
const envName = process.argv[2];
|
|
|
|
const expoStart = spawn("expo", ["start", "-c"]);
|
|
|
|
expoStart.stdout.on("data", (data) => {
|
|
if (data.toString().includes("Logs for your project will appear below")) {
|
|
expoStart.kill("SIGINT");
|
|
}
|
|
});
|
|
|
|
expoStart.on("close", () => {
|
|
const env = { ...process.env, NODE_ENV: envName };
|
|
spawn("expo", ["run:android"], { env, stdio: "inherit" });
|
|
});
|