Skip to content

Commit aa55bbb

Browse files
committed
Make the github org and repo an env var
1 parent b393a6a commit aa55bbb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/cli/src/command-helpers/local-node.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { createGunzip } from 'node:zlib';
88
import decompress from 'decompress';
99
import fetch from '../fetch.js';
1010

11+
// Add GitHub repository configuration via environment variables with defaults
12+
const GRAPH_NODE_GITHUB_OWNER = process.env.GRAPH_NODE_GITHUB_OWNER || 'graphprotocol';
13+
const GRAPH_NODE_GITHUB_REPO = process.env.GRAPH_NODE_GITHUB_REPO || 'graph-node';
14+
1115
function getPlatformBinaryName(): string {
1216
const platform = os.platform();
1317
const arch = os.arch();
@@ -43,7 +47,7 @@ async function getLatestGithubRelease(owner: string, repo: string) {
4347
}
4448

4549
export async function getLatestGraphNodeRelease(): Promise<string> {
46-
return getLatestGithubRelease('graphprotocol', 'graph-node');
50+
return getLatestGithubRelease(GRAPH_NODE_GITHUB_OWNER, GRAPH_NODE_GITHUB_REPO);
4751
}
4852

4953
export async function downloadGraphNodeRelease(
@@ -55,8 +59,8 @@ export async function downloadGraphNodeRelease(
5559

5660
try {
5761
return await downloadGithubRelease(
58-
'graphprotocol',
59-
'graph-node',
62+
GRAPH_NODE_GITHUB_OWNER,
63+
GRAPH_NODE_GITHUB_REPO,
6064
release,
6165
outputDir,
6266
fileName,

0 commit comments

Comments
 (0)