Skip to content

Commit cfabf41

Browse files
committed
gen keys
1 parent fbf843f commit cfabf41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/generateKeys.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ console.log("Generating keys...");
1111
const walletKey = generatePrivateKey();
1212
const encryptionKeyHex = generateEncryptionKeyHex();
1313

14-
const envFilePath = join(__dirname, "../.env");
14+
const targetDir = process.argv[2] || ".";
15+
const filePath = join(targetDir, ".env");
1516

1617
await writeFile(
17-
envFilePath,
18+
filePath,
1819
`WALLET_KEY=${walletKey}
1920
ENCRYPTION_KEY=${encryptionKeyHex}
2021
`,
2122
);
2223

23-
console.log(`Keys written to ${envFilePath}`);
24+
console.log(`Keys written to ${filePath}`);

0 commit comments

Comments
 (0)