Skip to content

Commit 457314a

Browse files
Fix env vars being baked-in at build-time
1 parent 92c23de commit 457314a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

util/dotnet.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import path from 'path'
22
import { readdir } from 'node:fs/promises';
33

44
export const getDownloadDirectory = (): string => {
5-
if (!process.env['HOME']) {
5+
if (!Bun.env.HOME) {
66
throw new Error(`ENV var 'HOME' not defined`)
77
}
88

9-
return path.join(process.env['HOME'], 'Downloads')
9+
return path.join(Bun.env.HOME, 'Downloads')
1010
}
1111

1212
export const hasInstallScript = async (): Promise<boolean> => {
@@ -23,11 +23,11 @@ export const getInstallScriptPath = () => {
2323
}
2424

2525
export const getDotnetRootPath = () => {
26-
if (!process.env['HOME']) {
26+
if (!Bun.env.HOME) {
2727
throw new Error(`ENV var 'HOME' not defined`)
2828
}
2929

30-
return path.join(process.env['HOME'], '.dotnet')
30+
return path.join(Bun.env.HOME, '.dotnet')
3131
}
3232

3333
export type DotnetSdk = {
@@ -76,7 +76,7 @@ export const syncSdk = async (sdk: DotnetSdk) => {
7676
stdout: 'inherit',
7777
stderr: 'inherit',
7878
env: {
79-
...process.env,
79+
...Bun.env,
8080
DOTNET_ROOT: getDotnetRootPath()
8181
}
8282
})
@@ -99,7 +99,7 @@ export const syncRuntime = async (runtime: DotnetRuntime) => {
9999
stdout: 'inherit',
100100
stderr: 'inherit',
101101
env: {
102-
...process.env,
102+
...Bun.env,
103103
DOTNET_ROOT: getDotnetRootPath()
104104
}
105105
})

util/lists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const getListPreference = (argv: Argv): ListPreference => {
66
return argv.output as ListPreference
77
}
88

9-
return process.env['LIST_PREFERENCE'] as ListPreference ?? 'tsv'
9+
return Bun.env['LIST_PREFERENCE'] as ListPreference ?? 'tsv'
1010
}
1111

1212
export const outputList = (objects: any[], listPreference: ListPreference = 'tsv') => {

0 commit comments

Comments
 (0)