mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Fix bug on windows
This commit is contained in:
@@ -138,6 +138,14 @@ class ImageCaches {
|
|||||||
String p = path.join(dir.path, u.host.isEmpty ? "nohost" : u.host,
|
String p = path.join(dir.path, u.host.isEmpty ? "nohost" : u.host,
|
||||||
u.path.substring(1) + (u.hasQuery ? "?${u.query}" : ""));
|
u.path.substring(1) + (u.hasQuery ? "?${u.query}" : ""));
|
||||||
final d = _fs.directory(path.dirname(p));
|
final d = _fs.directory(path.dirname(p));
|
||||||
|
if (isWindows) {
|
||||||
|
if (path.isAbsolute(p)) {
|
||||||
|
p = p.substring(0, 2) +
|
||||||
|
p.substring(2).replaceAll(RegExp("[:\\*\\?\"\\<\\>\\|]"), '_');
|
||||||
|
} else {
|
||||||
|
p = p.replaceAll(RegExp("[:\\*\\?\"\\<\\>\\|]"), '_');
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!(await d.exists())) {
|
if (!(await d.exists())) {
|
||||||
await d.create(recursive: true);
|
await d.create(recursive: true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user