conda / conda/menuinst

Add --set-global-placeholder CLI flag for custom placeholders

Open
#479 1 comment 0 reactions 1 assignee Claimed by @lrandersson View on GitHub
type::feature
Dominant language
Python
Stars
50
Forks
49
Avg merge
1d 11h
Merged PRs (30d)
16

Description

### Checklist

- [x] I added a descriptive title
- [x] I searched open requests and couldn't find a duplicate

### What is the idea?

Add a CLI flag to set custom placeholders that persist in `menuinst.toml` and can be used in menu JSON files via `{{ PLACEHOLDER_NAME }}` syntax.
Origin of this feature is from this conversation: https://github.com/conda/menuinst/pull/477#discussion_r3241873748.

### Why is this needed?

Some installers need to set placeholders such as `DISTRIBUTION_NAME` dynamically at install time. Currently this requires special-cased code. A general-purpose CLI flag would:
- Eliminate special-casing
- Enable future custom placeholders without code changes
- Provide a clean interface for constructor and other installers

### What should happen?

1. User runs `menuinst --set-global-placeholder KEY=value --prefix `
2. Value is stored in `[placeholders]` section of `$PREFIX/Menu/menuinst.toml`
3. Menu JSON files can reference `{{ KEY }}` which resolves to the stored value
4. Environment variable `MENUINST_KEY` can override the stored value

### Additional Context

Discussed in PR #477 review comments.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.