summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/utils/path.ts
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-10-03 09:04:28 -0500
committerAdam <[email protected]>2025-10-03 09:04:28 -0500
commit3fa280d21878ae391674a21758199df3d2d8c3b5 (patch)
treef70c6ecafffeecc8e7a59dc9acef66c59a9ea54a /packages/desktop/src/utils/path.ts
parent1d58b5548287a3e32ffce3abdcf0f2db08fdb155 (diff)
downloadopencode-3fa280d21878ae391674a21758199df3d2d8c3b5.tar.gz
opencode-3fa280d21878ae391674a21758199df3d2d8c3b5.zip
chore: app -> desktop
Diffstat (limited to 'packages/desktop/src/utils/path.ts')
-rw-r--r--packages/desktop/src/utils/path.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/desktop/src/utils/path.ts b/packages/desktop/src/utils/path.ts
new file mode 100644
index 000000000..9c026ca41
--- /dev/null
+++ b/packages/desktop/src/utils/path.ts
@@ -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]
+}