oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.1k stars 2.67k forks source link

Bun does not respect `.bunfig.toml` #5636

Open pro-sumer opened 12 months ago

pro-sumer commented 12 months ago

What version of Bun is running?

1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49

What platform is your computer?

Darwin 22.6.0 x86_64 i386

What steps can reproduce the bug?

Execute:

bun pm bin --global

with $XDG_CONFIG_HOME/.bunfig.toml:

[install]
globalDir = "/usr/local/Bun/lib"
globalBinDir = "/usr/local/Bun/bin"

What is the expected behavior?

/usr/local/Bun/bin

What do you see instead?

/Users/rob/.cache/.bun/bin

Additional information

Problem also occurs with ~/.bunfig.toml instead of $XDG_CONFIG_HOME/.bunfig.toml.

PS: similar error for bin pm cache --global

casret commented 12 months ago

Yeah, been beating my head against this as well. For me it was install.cache.dir is not being honored.

Leftium commented 5 months ago

I was able to use the BUN_INSTALL_CACHE_DIR env var.

Perhaps you can use BUN_INSTALL_BIN and BUN_INSTALL_GLOBAL_DIR?

Here are some other bun env variables:

BUN_CANARY
BUN_CONFIG_HTTP_RETRY_COUNT
BUN_CONFIG_LINK_NATIVE_BINS
BUN_CONFIG_LOCKFILE_SAVE_PATH
BUN_CONFIG_MAX_HTTP_REQUESTS
BUN_CONFIG_NO_DEDUPLICATE
BUN_CONFIG_NO_VERIFY
BUN_CONFIG_SKIP_INSTALL_PACKAGES
BUN_CONFIG_SKIP_LOAD_LOCKFILE
BUN_CONFIG_SKIP_SAVE_LOCKFILE
BUN_CONFIG_YARN_LOCKFILE
BUN_CRASH_WITHOUT_JIT
BUN_CREATE_DIR
BUN_DEBUG_
BUN_DEBUG_ALL
BUN_DEPS_DIR
BUN_DEPS_OUT_DIR
BUN_DISABLE_BUN_JS
BUN_DISABLE_TRANSPILER
BUN_DISABLE_UPGRADE_CHECK
BUN_DRY_RUN
BUN_FORCE_HMR
BUN_INSTALL
BUN_INSTALL_BIN
BUN_INSTALL_CACHE_DIR
BUN_INSTALL_GLOBAL_DIR
BUN_INSTALL_PROGRESS
BUN_INSTALL_VERBOSE
BUN_MANIFEST_CACHE
BUN_TMPDIR