2024-02-06 16:42:41 -07:00
|
|
|
const { spawn } = require("child_process");
|
|
|
|
|
|
|
|
const envName = process.argv[2];
|
|
|
|
|
|
|
|
const expoStart = spawn("expo", ["start", "-c"]);
|
|
|
|
|
|
|
|
expoStart.stdout.on("data", (data) => {
|
|
|
|
console.log(`${data}`);
|
|
|
|
|
|
|
|
if (data.toString().includes("Logs for your project will appear below")) {
|
|
|
|
console.log("Shutting down the server...");
|
|
|
|
expoStart.kill("SIGINT");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
expoStart.on("close", () => {
|
|
|
|
const env = { ...process.env, NODE_ENV: envName };
|
2024-02-06 17:06:09 -07:00
|
|
|
spawn("expo", ["run:android"], { env, stdio: 'inherit' });
|
2024-02-06 16:42:41 -07:00
|
|
|
});
|