mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Add some command line params
This commit is contained in:
parent
3d28f0a674
commit
e65d20be79
@ -94,6 +94,16 @@ public class Main {
|
||||
uOptions.side = UpdateManager.Options.Side.from(side);
|
||||
}
|
||||
|
||||
String packFolder = cmd.getOptionValue("pack-folder");
|
||||
if (packFolder != null) {
|
||||
uOptions.packFolder = packFolder;
|
||||
}
|
||||
|
||||
String metaFile = cmd.getOptionValue("meta-file");
|
||||
if (metaFile != null) {
|
||||
uOptions.manifestFile = metaFile;
|
||||
}
|
||||
|
||||
try {
|
||||
uOptions.downloadURI = new URI(unparsedArgs[0]);
|
||||
} catch (URISyntaxException e) {
|
||||
@ -122,6 +132,8 @@ public class Main {
|
||||
public static void addNonBootstrapOptions(Options options) {
|
||||
options.addOption("s", "side", true, "Side to install mods from (client/server, defaults to client)");
|
||||
options.addOption(null, "title", true, "Title of the installer window");
|
||||
options.addOption(null, "pack-folder", true, "Folder to install the pack to (defaults to the JAR directory)");
|
||||
options.addOption(null, "meta-file", true, "JSON file to store pack metadata, relative to the pack folder (defaults to packwiz.json)");
|
||||
}
|
||||
|
||||
// TODO: link these somehow so they're only defined once?
|
||||
|
@ -8,8 +8,9 @@ public class UpdateManager {
|
||||
public final IUserInterface ui;
|
||||
|
||||
public static class Options {
|
||||
public URI downloadURI;
|
||||
public String manifestFile = "packwiz.json";
|
||||
public URI downloadURI = null;
|
||||
public String manifestFile = "packwiz.json"; // TODO: make configurable
|
||||
public String packFolder = ".";
|
||||
public Side side = Side.CLIENT;
|
||||
|
||||
public static enum Side {
|
||||
@ -66,23 +67,11 @@ public class UpdateManager {
|
||||
}
|
||||
|
||||
protected void start() {
|
||||
this.checkOptions();
|
||||
ui.submitProgress(new InstallProgress("Loading pack file..."));
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// Big oof
|
||||
}
|
||||
ui.submitProgress(new InstallProgress("Loading metadata", 1, 2));
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// Big oof
|
||||
}
|
||||
ui.submitProgress(new InstallProgress("Loading magic", 2, 2));
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// Big oof
|
||||
}
|
||||
|
||||
protected void checkOptions() {
|
||||
// TODO: implement
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user