Make some changes to allow not using steamcmd for mod downloads
This commit is contained in:
parent
54f90c7cdb
commit
16c935d904
4 changed files with 151 additions and 24 deletions
|
@ -17,6 +17,50 @@ class PathHelper {
|
|||
return this;
|
||||
}
|
||||
|
||||
PathHelper conditionalResolve(bool flag, String path) {
|
||||
if (flag) pth += Platform.pathSeparator + path;
|
||||
return this;
|
||||
}
|
||||
|
||||
bool deleteDirectory({bool recursive = false}) {
|
||||
Directory dir = new Directory(build());
|
||||
try {
|
||||
dir.deleteSync(recursive: recursive);
|
||||
|
||||
return true;
|
||||
} catch (E) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool deleteFile() {
|
||||
File file = new File(build());
|
||||
try {
|
||||
file.deleteSync(recursive: true);
|
||||
|
||||
return true;
|
||||
} catch (E) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PathHelper removeDir() {
|
||||
deleteDirectory(recursive: true);
|
||||
return this;
|
||||
}
|
||||
|
||||
PathHelper removeFile() {
|
||||
deleteFile();
|
||||
return this;
|
||||
}
|
||||
|
||||
PathHelper mkdir() {
|
||||
Directory dir = new Directory(build());
|
||||
dir.createSync(recursive: true);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
String build() {
|
||||
return pth;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue