Skip to content

Commit 32c0178

Browse files
committed
fix: get envDir path from the function argument
1 parent 242a42e commit 32c0178

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cmd/bootstrap.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const bootstrapSops = async (
7474
obj.keys = publicKey
7575
if (privateKey && !process.env.SOPS_AGE_KEY) {
7676
process.env.SOPS_AGE_KEY = privateKey
77-
await deps.writeFile(`${env.ENV_DIR}/.secrets`, `SOPS_AGE_KEY=${privateKey}`)
77+
await deps.writeFile(`${envDir}/.secrets`, `SOPS_AGE_KEY=${privateKey}`)
7878
}
7979
}
8080

@@ -87,21 +87,21 @@ export const bootstrapSops = async (
8787
d.info('Copying sops related files')
8888
// add sops related files
8989
const file = '.gitattributes'
90-
await deps.copyFile(`${rootDir}/.values/${file}`, `${env.ENV_DIR}/${file}`)
90+
await deps.copyFile(`${rootDir}/.values/${file}`, `${envDir}/${file}`)
9191

9292
// prepare some credential files the first time and crypt some
9393
if (!exists) {
9494
if (isCli || env.OTOMI_DEV) {
9595
// first time so we know we have values
96-
const secretsFile = `${env.ENV_DIR}/.secrets`
96+
const secretsFile = `${envDir}/.secrets`
9797
d.log(`Creating secrets file: ${secretsFile}`)
9898
if (provider === 'google') {
9999
// and we also assume the correct values are given by using '!' (we want to err when not set)
100100
const serviceKeyJson = JSON.parse(values.kms.sops!.google!.accountJson as string)
101101
// and set it in env for later decryption
102102
process.env.GCLOUD_SERVICE_KEY = values.kms.sops!.google!.accountJson
103103
d.log('Creating gcp-key.json for vscode.')
104-
await deps.writeFile(`${env.ENV_DIR}/gcp-key.json`, JSON.stringify(serviceKeyJson))
104+
await deps.writeFile(`${envDir}/gcp-key.json`, JSON.stringify(serviceKeyJson))
105105
d.log(`Creating credentials file: ${secretsFile}`)
106106
await deps.writeFile(secretsFile, `GCLOUD_SERVICE_KEY=${JSON.stringify(JSON.stringify(serviceKeyJson))}`)
107107
} else if (provider === 'aws') {

0 commit comments

Comments
 (0)