INNER CODE UNIT · JavaScript

readGit

aozorae/Edgechat · frontend/build-metadata.js:6

function readGit(args) {
	try {
		return execFileSync("git", args, {
			cwd: projectRoot,
			encoding: "utf8",
			stdio: ["ignore", "pipe", "ignore"],
		}).trim();
	} catch {
		return "";
	}
}

export function parseGithubRepository(remoteUrl) {
	const match = String(remoteUrl || "")
		.trim()
		.match(/github\.com[/:]([^/:\s]+)\/([^/\s]+?)(?:\.git)?$/i);
	return match ? `${match[1]}/${match[2]}` : "";
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…