Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions e2e/backend/test_http
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,15 @@ EOF
mise uninstall --all && mise install
mise env
assert_contains "mise x -- hello-world" "hello world"

# Test HTTP backend with Tera {{ version }} templating syntax (with spaces)
# This tests the fix for https://github.com/jdx/mise/discussions/7748
# Note: postinstall uses literal version since it's a shell command executed directly
cat <<'EOF' >mise.toml
[tools]
"http:hello-tera" = { version = "1.0.0", url = "https://mise.jdx.dev/test-fixtures/hello-world-{{ version }}.tar.gz", bin_path = "hello-world-{{ version }}/bin", postinstall = "chmod +x $MISE_TOOL_INSTALL_PATH/hello-world-1.0.0/bin/hello-world" }
EOF

mise uninstall --all && mise install
mise env
assert_contains "mise x -- hello-world" "hello world"
6 changes: 5 additions & 1 deletion src/config/config_file/mise_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,12 @@ impl ConfigFile for MiseToml {
for tool in &tvp.0 {
let version = self.parse_template_with_context(&context, &tool.tt.to_string())?;
let tvr = if let Some(mut options) = tool.options.clone() {
// Add placeholder for version since it's not available at config load time
// This preserves {{ version }} in the output for install-time rendering
let mut opts_context = context.clone();
opts_context.insert("version", "{{ version }}");
for v in options.opts.values_mut() {
*v = self.parse_template_with_context(&context, v)?;
*v = self.parse_template_with_context(&opts_context, v)?;
}
let mut ba = ba.clone();
// Start with cached options but filter out install-time-only options
Expand Down
Loading