refactor: path/absolute?

This commit is contained in:
Tienson Qin
2023-03-27 18:47:32 +08:00
committed by Andelf
parent 80f708831b
commit c1e8d6ed8e
8 changed files with 26 additions and 18 deletions

View File

@@ -102,7 +102,8 @@
rel-path (when (string/starts-with? path repo-dir)
(path/trim-dir-prefix repo-dir path))
original-name (db/get-file-page (or path rel-path))
in-db? (boolean (db/get-file (or path rel-path)))
in-db? (when-not (path/absolute? path)
(boolean (db/get-file (or path rel-path))))
file-fpath (if in-db?
(path/path-join repo-dir path)
path)