mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 10:14:22 +01:00
chore: app -> desktop
This commit is contained in:
14
packages/desktop/src/utils/path.ts
Normal file
14
packages/desktop/src/utils/path.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export function getFilename(path: string) {
|
||||
const parts = path.split("/")
|
||||
return parts[parts.length - 1]
|
||||
}
|
||||
|
||||
export function getDirectory(path: string) {
|
||||
const parts = path.split("/")
|
||||
return parts.slice(0, parts.length - 1).join("/")
|
||||
}
|
||||
|
||||
export function getFileExtension(path: string) {
|
||||
const parts = path.split(".")
|
||||
return parts[parts.length - 1]
|
||||
}
|
||||
Reference in New Issue
Block a user