Autofill launch name on version import (#373) (#447)

Co-authored-by: Robert Clabough <robert@clabough.tech>
This commit is contained in:
AgentScrubbles
2026-07-23 14:38:04 -07:00
committed by GitHub
parent d0c3b2fdb6
commit 8e75a0bf56
@@ -292,6 +292,18 @@ const launchFilteredVersionGuesses = computed(() =>
function updateLaunchCommand(command: string) {
launchConfiguration.value.launch = command;
// Auto-fill name from filename if user hasn't set one (#373)
if (!launchConfiguration.value.name) {
const guess = props.versionGuesses?.find((v) => v.filename === command);
if (guess?.type === "emulator") {
launchConfiguration.value.name = guess.launchName;
} else {
const basename = command.split("/").pop() ?? command;
launchConfiguration.value.name = basename.replace(/\.[^.]+$/, "");
}
}
if (launchConfiguration.value.platform === undefined) {
const autosetGuess = props.versionGuesses?.find(
(v) => v.filename == command,