Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b922840
feat(prepare): add `mise prepare` command for dependency preparation
jdx Dec 13, 2025
93a4ba3
fix(prepare): run prepare after tool installation and add tests
jdx Dec 14, 2025
b523a5e
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 14, 2025
6bd9a83
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Dec 14, 2025
2a9909e
refactor(prepare): make providers opt-in with per-provider auto setting
jdx Dec 15, 2025
dcf587f
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 15, 2025
7b246d7
feat(prepare): show staleness warning in mise activate shells
jdx Dec 15, 2025
8e41edb
refactor(prepare): split npm provider into npm/yarn/pnpm/bun
jdx Dec 15, 2025
3eb9fb4
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 15, 2025
ce14743
feat(prepare): add cargo, go, pip, poetry, uv, bundler, composer prov…
jdx Dec 15, 2025
1d04a19
perf(prepare): run providers in parallel
jdx Dec 15, 2025
5595530
docs(prepare): add documentation and experimental badge
jdx Dec 15, 2025
affbf15
fix(prepare): fix multiple bugs in prepare system
jdx Dec 15, 2025
6564ba9
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 15, 2025
62f30c3
fix(prepare): use shell_words for proper command parsing
jdx Dec 15, 2025
d31d4b1
fix(prepare): fix toolset env and duplicate dry-run output
jdx Dec 15, 2025
a761d0a
fix(prepare): use &Path instead of &PathBuf in provider constructors
jdx Dec 15, 2025
7c9ceb2
fix(e2e-win): make prepare and task tests self-contained
jdx Dec 15, 2025
f0e689f
fix(prepare): fix remaining clippy warning and Windows e2e tests
jdx Dec 15, 2025
9646869
fix(run): check task --help before toolset/prepare; fix Windows e2e t…
jdx Dec 15, 2025
1af1bdf
fix(e2e): use physical path instead of PSDrive path in Windows tests
jdx Dec 15, 2025
612bb52
Merge remote-tracking branch 'origin/main' into feat/prepare
jdx Dec 15, 2025
cab891a
fix(prepare): remove cargo provider with broken freshness check
jdx Dec 15, 2025
27a874d
docs(prepare): remove cargo provider references
jdx Dec 15, 2025
9e07b69
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 15, 2025
d6771e9
fix(prepare): update CLI doc comment to remove cargo reference
jdx Dec 15, 2025
13d8186
test(prepare): remove cargo provider e2e test
jdx Dec 15, 2025
4dab79f
fix(e2e): use explicit $TestDrive paths in prepare tests
jdx Dec 15, 2025
2a1c8a5
fix(prepare): use go mod vendor when vendor/ exists
jdx Dec 15, 2025
30c20fc
fix(prepare): consistent freshness for globs matching no files
jdx Dec 15, 2025
f6fa6e3
fix(prepare): Windows test PSDrive path and Go provider applicability
jdx Dec 15, 2025
072fef2
fix(prepare): Windows tests and directory freshness check
jdx Dec 15, 2025
d988a0d
fix(prepare): Windows e2e tests use isolated subdirectories
jdx Dec 15, 2025
8ee5668
fix(prepare): don't remove MISE_EXPERIMENTAL in Windows tests
jdx Dec 15, 2025
6337151
fix(test): set MISE_EXPERIMENTAL in vfox test
jdx Dec 15, 2025
e379ef8
fix(prepare): Windows tests set MISE_CONFIG_FILE to prevent parent co…
jdx Dec 15, 2025
b3e0ed3
fix(prepare): skip complex Windows tests, keep basic test
jdx Dec 15, 2025
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
Prev Previous commit
Next Next commit
fix(run): check task --help before toolset/prepare; fix Windows e2e t…
…ests

- Move task help flag check before toolset installation and prepare
  steps to avoid unnecessary delays for `mise run mytask --help`
- Add MISE_TRUSTED_CONFIG_PATHS to Windows e2e tests so TestDrive
  configs are trusted

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
jdx and claude committed Dec 15, 2025
commit 9646869568b94142eeb747472d471a6bb03c3d9e
3 changes: 3 additions & 0 deletions e2e-win/prepare.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ Describe 'prepare' {
BeforeAll {
$originalPath = Get-Location
Set-Location TestDrive:
# Trust the TestDrive config path
$env:MISE_TRUSTED_CONFIG_PATHS = (Get-Location).Path
}

AfterAll {
Set-Location $originalPath
Remove-Item -Path Env:\MISE_TRUSTED_CONFIG_PATHS -ErrorAction SilentlyContinue
}

AfterEach {
Expand Down
3 changes: 3 additions & 0 deletions e2e-win/task.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Describe 'task' {
BeforeAll {
$originalPath = Get-Location
Set-Location TestDrive:
# Trust the TestDrive config path
$env:MISE_TRUSTED_CONFIG_PATHS = (Get-Location).Path

# Create mise.toml that includes tasks directory
@'
Expand Down Expand Up @@ -33,6 +35,7 @@ Write-Output "windows"

AfterAll {
Set-Location $originalPath
Remove-Item -Path Env:\MISE_TRUSTED_CONFIG_PATHS -ErrorAction SilentlyContinue
}

BeforeEach {
Expand Down
71 changes: 36 additions & 35 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,48 +210,18 @@ impl Run {
return Ok(());
}

let mut config = Config::get().await?;

// Build and install toolset so tools like npm are available for prepare
let mut ts = ToolsetBuilder::new()
.with_args(&self.tool)
.with_default_to_latest(true)
.build(&config)
.await?;

let opts = InstallOptions {
jobs: self.jobs,
raw: self.raw,
..Default::default()
};
ts.install_missing_versions(&mut config, &opts).await?;

// Run auto-enabled prepare steps (unless --no-prepare)
if !self.no_prepare {
let env = ts.env_with_path(&config).await?;
let engine = PrepareEngine::new(config.clone())?;
engine
.run(PrepareOptions {
auto_only: true, // Only run providers with auto=true
env,
..Default::default()
})
.await?;
}

// Unescape task args that were escaped to prevent clap from parsing them
// Unescape task args early so we can check for help flags
self.args = unescape_task_args(&self.args);

if !self.skip_deps {
self.skip_deps = Settings::get().task_skip_depends;
}

// Check if --help or -h is in the task args
// Check if --help or -h is in the task args BEFORE toolset/prepare
// NOTE: Only check self.args, not self.args_last, because args_last contains
// arguments after explicit -- which should always be passed through to the task
let has_help_in_task_args =
self.args.contains(&"--help".to_string()) || self.args.contains(&"-h".to_string());

let mut config = Config::get().await?;

// Handle task help early to avoid unnecessary toolset/prepare work
if has_help_in_task_args {
// Build args list to get the task (filter out --help/-h for task lookup)
let args = once(self.task.clone())
Expand Down Expand Up @@ -284,6 +254,37 @@ impl Run {
}
}

// Build and install toolset so tools like npm are available for prepare
let mut ts = ToolsetBuilder::new()
.with_args(&self.tool)
.with_default_to_latest(true)
.build(&config)
.await?;

let opts = InstallOptions {
jobs: self.jobs,
raw: self.raw,
..Default::default()
};
ts.install_missing_versions(&mut config, &opts).await?;

// Run auto-enabled prepare steps (unless --no-prepare)
if !self.no_prepare {
let env = ts.env_with_path(&config).await?;
let engine = PrepareEngine::new(config.clone())?;
engine
.run(PrepareOptions {
auto_only: true, // Only run providers with auto=true
env,
..Default::default()
})
.await?;
}

if !self.skip_deps {
self.skip_deps = Settings::get().task_skip_depends;
}

time!("run init");
let tmpdir = tempfile::tempdir()?;
self.tmpdir = tmpdir.path().to_path_buf();
Expand Down
Loading