chore: updated init infisical

This commit is contained in:
John Yeo
2025-12-09 10:46:24 +00:00
parent 26e49ff268
commit 98ca819509

View File

@@ -32,6 +32,7 @@ export const initInfisical = async (params?: { secretPath?: string }) => {
environment,
projectId,
secretPath: params?.secretPath,
includeImports: true,
});
// Load secrets into process.env
@@ -45,6 +46,15 @@ export const initInfisical = async (params?: { secretPath?: string }) => {
}
}
for (const importSecrets of allSecrets?.imports ?? []) {
for (const importSecret of importSecrets.secrets) {
if (!process.env[importSecret.secretKey]) {
process.env[importSecret.secretKey] = importSecret.secretValue;
loadedCount++;
}
}
}
console.log(`✅ Infisical: loaded ${loadedCount} secrets into process.env`);
} catch (error) {
console.error("❌ Failed to initialize Infisical:", error);