Skip to content

Commit 18587b8

Browse files
use DEPLOYMENT_FILE_PATH env variable
1 parent d9404a4 commit 18587b8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/autonom/fetchAddresses.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import fs from "fs";
22

3-
const DEPLOYMENT_FILE_PATH = "/Users/goktug/Desktop/deneme/autonom/contracts/deployments/local/l2.json";
3+
const DEPLOYMENT_FILE_PATH = process.env.DEPLOYMENT_FILE_PATH;
44
const OUTPUT_FILE = "./src/utils/autonom/output/l2.js";
55

66
// helper function to safely extract nested values
77
function getSafeValue(obj, keys, defaultValue = "MISSING_ADDRESS") {
88
return keys.reduce((acc, key) => (acc && acc[key] ? acc[key] : defaultValue), obj);
99
}
1010

11+
if (!DEPLOYMENT_FILE_PATH) {
12+
console.error("Deployment file path is required. Set the DEPLOYMENT_FILE_PATH environment variable.");
13+
process.exit(1);
14+
}
15+
1116
try {
1217
if (!fs.existsSync(DEPLOYMENT_FILE_PATH)) {
1318
throw new Error(`Deployment file not found at ${DEPLOYMENT_FILE_PATH}`);

0 commit comments

Comments
 (0)