mirror of
https://github.com/jbranchaud/til
synced 2026-03-04 06:58:45 +00:00
Add Override Your Project Mise File as a Mise TIL
This commit is contained in:
@@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/).
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter).
|
||||
|
||||
_1739 TILs and counting..._
|
||||
_1740 TILs and counting..._
|
||||
|
||||
See some of the other learning resources I work on:
|
||||
|
||||
@@ -755,6 +755,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
||||
- [Create Umbrella Task For All Test Tasks](mise/create-umbrella-task-for-all-test-tasks.md)
|
||||
- [List The Files Being Loaded By Mise](mise/list-the-files-being-loaded-by-mise.md)
|
||||
- [Look In Ruby Version Dotfile](mise/look-in-ruby-version-dotfile.md)
|
||||
- [Override Your Project Mise File](mise/override-your-project-mise-file.md)
|
||||
- [Preserve Color Output For Task Command](mise/preserve-color-output-for-task-command.md)
|
||||
- [Read Existing Dot Env File Into Env Vars](mise/read-existing-dot-env-file-into-env-vars.md)
|
||||
- [Run A Command With Specific Tool Version](mise/run-a-command-with-specific-tool-version.md)
|
||||
|
||||
37
mise/override-your-project-mise-file.md
Normal file
37
mise/override-your-project-mise-file.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Override Your Project Mise File
|
||||
|
||||
A project I'm working on has a version-controlled `.mise.toml` file in it. Some
|
||||
changes were made to that recently that introduce some env vars that conflict
|
||||
with my setup. If I make edits to that file, then I have a modified version of
|
||||
`.mise.toml` sitting in my Git working copy.
|
||||
|
||||
```
|
||||
# .mise.toml
|
||||
[env]
|
||||
CONFIG_SETTING = "project"
|
||||
```
|
||||
|
||||
Instead, I can rely on the loading precedence rules of `mise` to override those
|
||||
project settings with my individual settings. I can do that with the
|
||||
`.mise.local.toml` file which is played on top of any `mise` configuration from
|
||||
files further down the precedence chain.
|
||||
|
||||
```
|
||||
# .mise.local.toml
|
||||
[env]
|
||||
CONFIG_SETTING = "override"
|
||||
```
|
||||
|
||||
Assuming I have `mise` setup with my shell environment to automatically load in
|
||||
these files, I can now check what takes precedence:
|
||||
|
||||
```bash
|
||||
$ echo $CONFIG_SETTING
|
||||
override
|
||||
```
|
||||
|
||||
Make sure `.mise.local.toml` is included in the `.gitignore` file to avoid
|
||||
checking in your personal environment overrides.
|
||||
|
||||
To be sure about what files are loaded and in what order, give `mise cfg` a try.
|
||||
I discuss that in more detail in [List The Files Being Loaded By Mise](list-the-files-being-loaded-by-mise.md).
|
||||
Reference in New Issue
Block a user