Skip to content

Commit

Permalink
feat: allow inserting PATH in env._.source
Browse files Browse the repository at this point in the history
Fixes #3646
  • Loading branch information
jdx committed Dec 18, 2024
1 parent 577ff7d commit 010061a
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 84 deletions.
90 changes: 45 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions e2e/env/test_env_source
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ EOF

cat >"$MISE_CONFIG_DIR/source.sh" <<EOF
export MISE_TEST_SOURCE=1234
export PATH="$HOME/newbin:$PATH"
EOF

assert "mise env -s bash | grep MISE_TEST_SOURCE" "export MISE_TEST_SOURCE=1234"
assert_contains "mise env -s bash | grep PATH" "export PATH='$HOME/newbin:"
8 changes: 0 additions & 8 deletions e2e/tasks/test_task_help

This file was deleted.

2 changes: 1 addition & 1 deletion mise.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ version = "0.2.3"
backend = "cargo:toml-cli"

[tools."cargo:usage-cli"]
version = "1.7.1"
version = "1.6.0"
backend = "cargo:usage-cli"

[tools.cosign]
Expand Down
2 changes: 1 addition & 1 deletion src/backend/asdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl AsdfBackend {
}
let script = sm.get_script_path(&ExecEnv);
let dir = dirs::CWD.clone().unwrap_or_default();
let ed = EnvDiff::from_bash_script(&script, &dir, &sm.env)?;
let ed = EnvDiff::from_bash_script(&script, &dir, &sm.env, Default::default())?;
let env = ed
.to_patches()
.into_iter()
Expand Down
5 changes: 0 additions & 5 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::collections::{BTreeMap, HashSet};
use std::io::Write;
use std::iter::once;
use std::ops::Deref;
use std::panic;
use std::path::{Path, PathBuf};
use std::process::Stdio;
use std::sync::Mutex;
Expand Down Expand Up @@ -232,10 +231,6 @@ impl Run {
s.spawn(|_| {
let task = t;
let tx_err = tx_err;
panic::set_hook(Box::new(|info| {
eprintln!("panic in task: {info}");
exit(1);
}));
if !self.is_stopping() {
trace!("running task: {task}");
if let Err(err) = self.run_task(&task) {
Expand Down
1 change: 1 addition & 0 deletions src/config/env_directive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ impl EnvResults {
&mut ctx,
&mut tera,
&mut env,
&mut paths,
&mut r,
normalize_path,
&source,
Expand Down
Loading

0 comments on commit 010061a

Please sign in to comment.