mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-16 02:52:06 +00:00
fix: Support any extension for shell names across platforms
This commit is contained in:
parent
9425e6d3c2
commit
13025084ec
1 changed files with 3 additions and 2 deletions
|
|
@ -147,8 +147,9 @@ export const SettingsGeneral: Component = () => {
|
|||
const getShortName = (p: string) => {
|
||||
const parts = p.split(/[/\\]/)
|
||||
let name = parts[parts.length - 1]
|
||||
if (name.toLowerCase().endsWith(".exe")) {
|
||||
name = name.slice(0, -4)
|
||||
const dotIndex = name.lastIndexOf(".")
|
||||
if (dotIndex > 0) {
|
||||
name = name.slice(0, dotIndex)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue