mirror of
https://github.com/stablyai/orca.git
synced 2026-10-27 08:02:51 +00:00
* fix: tighten GitHub submit shortcut handling * fix: expand backslash ssh home paths
19 lines
393 B
TypeScript
19 lines
393 B
TypeScript
import { homedir } from 'os'
|
|
import { join } from 'path'
|
|
|
|
export function resolveSshConfigHomePath(filepath: string): string {
|
|
if (filepath === '~') {
|
|
return homedir()
|
|
}
|
|
if (filepath.startsWith('~/') || filepath.startsWith('~\\')) {
|
|
return join(
|
|
homedir(),
|
|
...filepath
|
|
.slice(2)
|
|
.split(/[\\/]+/)
|
|
.filter(Boolean)
|
|
)
|
|
}
|
|
return filepath
|
|
}
|