mirror of
https://github.com/sst/opencode.git
synced 2025-07-08 00:25:00 +00:00
feat: add elixir file formatting (#458)
This commit is contained in:
parent
dbb6e55226
commit
334161a30e
1 changed files with 27 additions and 0 deletions
|
@ -132,5 +132,32 @@ export namespace Format {
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "mix format",
|
||||
command: ["mix", "format", "$FILE"],
|
||||
extensions: [
|
||||
".ex",
|
||||
".exs",
|
||||
".eex",
|
||||
".heex",
|
||||
".leex",
|
||||
".neex",
|
||||
".sface",
|
||||
],
|
||||
async enabled() {
|
||||
try {
|
||||
const proc = Bun.spawn({
|
||||
cmd: ["mix", "--version"],
|
||||
cwd: App.info().path.cwd,
|
||||
stdout: "ignore",
|
||||
stderr: "ignore",
|
||||
})
|
||||
const exit = await proc.exited
|
||||
return exit === 0
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue