mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-09 08:31:27 +00:00
Improve file tilde resolve
This commit is contained in:
1 file changed
+2
-1
@@ -208,7 +208,8 @@ public final class FilePath {
|
||||
}
|
||||
|
||||
public FilePath resolveTildeHome(FilePath dir) {
|
||||
return value.startsWith("~") ? FilePath.of(value.replace("~", dir.toString())) : this;
|
||||
var resolve = value.equals("~") || value.startsWith("~/") || value.startsWith("~\\");
|
||||
return resolve ? FilePath.of(dir.toString() + value.substring(1)) : this;
|
||||
}
|
||||
|
||||
public List<String> split() {
|
||||
|
||||
Reference in new issue
Block a user