This commit was merged in pull request #101.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { spawn } = require("child_process");
|
||||
const { spawn, execSync } = require("child_process");
|
||||
const { Readable } = require("stream");
|
||||
const { pipeline } = require("stream/promises");
|
||||
|
||||
@@ -127,6 +127,15 @@ function getExpoPublicReplId() {
|
||||
return process.env.REPL_ID || process.env.EXPO_PUBLIC_REPL_ID;
|
||||
}
|
||||
|
||||
function getGitSha() {
|
||||
try {
|
||||
return execSync("git rev-parse HEAD", { cwd: workspaceRoot }).toString().trim();
|
||||
} catch (error) {
|
||||
console.warn("Could not get git commit hash:", error.message);
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
async function startMetro(expoPublicDomain, expoPublicReplId) {
|
||||
const isRunning = await checkMetroHealth();
|
||||
if (isRunning) {
|
||||
@@ -136,10 +145,12 @@ async function startMetro(expoPublicDomain, expoPublicReplId) {
|
||||
|
||||
console.log("Starting Metro...");
|
||||
console.log(`Setting EXPO_PUBLIC_DOMAIN=${expoPublicDomain}`);
|
||||
const gitSha = getGitSha();
|
||||
const env = {
|
||||
...process.env,
|
||||
EXPO_PUBLIC_DOMAIN: expoPublicDomain,
|
||||
EXPO_PUBLIC_REPL_ID: expoPublicReplId,
|
||||
EXPO_PUBLIC_GIT_SHA: gitSha,
|
||||
};
|
||||
|
||||
if (expoPublicReplId) {
|
||||
|
||||
Reference in New Issue
Block a user