Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
args.password = process.env.PASSWORD
}

if (process.env.CS_DISABLE_FILE_DOWNLOADS) {
if (process.env.CS_DISABLE_FILE_DOWNLOADS === "1") {
args["disable-file-downloads"] = true
}

Expand All @@ -560,7 +560,6 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
delete process.env.PASSWORD
delete process.env.HASHED_PASSWORD
delete process.env.GITHUB_TOKEN
delete process.env.CS_DISABLE_FILE_DOWNLOADS

// Filter duplicate proxy domains and remove any leading `*.`.
const proxyDomains = new Set((args["proxy-domain"] || []).map((d) => d.replace(/^\*\./, "")))
Expand Down
5 changes: 4 additions & 1 deletion test/unit/node/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ describe("parser", () => {
})

it("should use env var CS_DISABLE_FILE_DOWNLOADS", async () => {
process.env.CS_DISABLE_FILE_DOWNLOADS = "0"
process.env.CS_DISABLE_FILE_DOWNLOADS = "1"
const args = parse([])
expect(args).toEqual({})

Expand All @@ -359,6 +359,9 @@ describe("parser", () => {
...defaults,
"disable-file-downloads": true,
})

// Cleanup
delete process.env.CS_DISABLE_FILE_DOWNLOADS
})

it("should error if password passed in", () => {
Expand Down