mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Gson isn't broken, I'm broken
This commit is contained in:
parent
d18e134140
commit
533c7a3ed5
@ -110,18 +110,16 @@ public class UpdateManager {
|
|||||||
|
|
||||||
ui.submitProgress(new InstallProgress("Loading manifest file..."));
|
ui.submitProgress(new InstallProgress("Loading manifest file..."));
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
ManifestFile manifest = null;
|
ManifestFile manifest;
|
||||||
try {
|
try {
|
||||||
manifest = gson.fromJson(new FileReader(Paths.get(opts.packFolder, opts.manifestFile).toString()),
|
manifest = gson.fromJson(new FileReader(Paths.get(opts.packFolder, opts.manifestFile).toString()),
|
||||||
ManifestFile.class);
|
ManifestFile.class);
|
||||||
} catch (FileNotFoundException e) { // Do nothing
|
} catch (FileNotFoundException e) {
|
||||||
|
manifest = new ManifestFile();
|
||||||
} catch (JsonSyntaxException | JsonIOException e) {
|
} catch (JsonSyntaxException | JsonIOException e) {
|
||||||
ui.handleExceptionAndExit(e);
|
ui.handleExceptionAndExit(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (manifest == null) {
|
|
||||||
manifest = new ManifestFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.submitProgress(new InstallProgress("Loading pack file..."));
|
ui.submitProgress(new InstallProgress("Loading pack file..."));
|
||||||
GeneralHashingSource packFileSource;
|
GeneralHashingSource packFileSource;
|
||||||
@ -142,7 +140,7 @@ public class UpdateManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packFileSource.hashIsEqual(manifest.packFileHash)) {
|
if (manifest.packFileHash != null && packFileSource.hashIsEqual(manifest.packFileHash)) {
|
||||||
System.out.println("Hash already up to date!");
|
System.out.println("Hash already up to date!");
|
||||||
// WOOO it's already up to date
|
// WOOO it's already up to date
|
||||||
// todo: --force?
|
// todo: --force?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user