fix: use process.env check instead of shell parameter expansion
The ${VAR:-default} syntax caused shell quoting errors inside the
bun -e argument. Instead, skip Infisical values for vars already
set via docker-compose environment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4b2728de27
commit
97ed8eff3a
|
|
@ -33,9 +33,10 @@ fetch_secrets() {
|
|||
if (!secrets.secrets) { console.error('[infisical:$5] No secrets returned'); process.exit(1); }
|
||||
|
||||
for (const s of secrets.secrets) {
|
||||
// Skip if already set via docker-compose/env (env overrides take precedence)
|
||||
if (process.env[s.secretKey]) continue;
|
||||
const escaped = s.secretValue.replace(/'/g, \"'\\\\''\" );
|
||||
// Only set if not already defined (docker-compose env takes precedence)
|
||||
console.log('export ' + s.secretKey + \"=\\${\" + s.secretKey + \":-'\" + escaped + \"'}\");
|
||||
console.log('export ' + s.secretKey + \"='\" + escaped + \"'\");
|
||||
}
|
||||
} catch (e) { console.error('[infisical:$5] Error:', e.message); process.exit(1); }
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in New Issue