Prepared for v0.1-alpha
This commit is contained in:
parent
b625887a56
commit
9d31a39774
|
@ -6,6 +6,8 @@ Dual is a simple management tool that allows you to create custom hostnames for
|
||||||
|
|
||||||
Make sure your configuration file [cfg/gen.cfg](cfg/gen.cfg) is correct before running this program.
|
Make sure your configuration file [cfg/gen.cfg](cfg/gen.cfg) is correct before running this program.
|
||||||
|
|
||||||
|
Please refer to the [wiki](https://git.luca0n.com/luca0N/Dual/wiki) to learn more about this program.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ java -jar Dual.jar
|
$ java -jar Dual.jar
|
||||||
```
|
```
|
||||||
|
|
|
@ -42,7 +42,7 @@ import com.luca0n.dual.config.ConfigUtil;
|
||||||
*/
|
*/
|
||||||
public class Dual {
|
public class Dual {
|
||||||
public static final String NAME = "Dual";
|
public static final String NAME = "Dual";
|
||||||
public static final String VERSION = "1.0";
|
public static final String VERSION = "0.1-alpha";
|
||||||
private static final String AUTO_GEN_COMMENT = "This entry was auto-generated by " + NAME + ".";
|
private static final String AUTO_GEN_COMMENT = "This entry was auto-generated by " + NAME + ".";
|
||||||
public static final int VERSION_CODE = 1;
|
public static final int VERSION_CODE = 1;
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ public class Dual {
|
||||||
public static void run() throws ConfigSyntaxException,
|
public static void run() throws ConfigSyntaxException,
|
||||||
NoSuchNamespaceException, NoSuchKeyException, IOException,
|
NoSuchNamespaceException, NoSuchKeyException, IOException,
|
||||||
UnsupportedOperatingSystemException, UnknownFetchTypeException {
|
UnsupportedOperatingSystemException, UnknownFetchTypeException {
|
||||||
|
System.out.printf("%s: started version v%s.\n", NAME, VERSION);
|
||||||
// Read configuration file
|
// Read configuration file
|
||||||
Config c = ConfigUtil.fromFile(ConfigUtil.DEFAULT_CONFIG);
|
Config c = ConfigUtil.fromFile(ConfigUtil.DEFAULT_CONFIG);
|
||||||
|
|
||||||
|
@ -81,15 +82,15 @@ public class Dual {
|
||||||
else if (target == null)
|
else if (target == null)
|
||||||
throw new NoSuchKeyException("Could not find required key Dual.Target in the default configuration file.");
|
throw new NoSuchKeyException("Could not find required key Dual.Target in the default configuration file.");
|
||||||
|
|
||||||
System.out.printf("%s: All tests passed.\n", NAME);
|
System.out.printf("%s: all tests passed.\n", NAME);
|
||||||
|
|
||||||
if (type == null){
|
if (type == null){
|
||||||
type = "Resolve";
|
type = "Resolve";
|
||||||
System.out.printf("%s: WARNING: no FetchType specified. Assuming Resolve FetchType...\n", NAME);
|
System.out.printf("%s: WARNING: no FetchType specified. Assuming Resolve FetchType...\n", NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.printf("%s: Using %s FetchType and %s Source.\n", NAME, type, source);
|
System.out.printf("%s: using %s FetchType and %s Source.\n", NAME, type, source);
|
||||||
System.out.printf("%s: Using %s hostname.\n", NAME, target);
|
System.out.printf("%s: using %s hostname.\n", NAME, target);
|
||||||
|
|
||||||
// Check OS.
|
// Check OS.
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
|
@ -182,5 +183,8 @@ public class Dual {
|
||||||
contents.append(line)
|
contents.append(line)
|
||||||
.append(System.lineSeparator());
|
.append(System.lineSeparator());
|
||||||
Files.write(path, contents.toString().getBytes());
|
Files.write(path, contents.toString().getBytes());
|
||||||
|
|
||||||
|
// Done!
|
||||||
|
System.out.printf("%s: done!\n", NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue