@@ -54,9 +54,9 @@ private static void startServer() throws Exception {
54
54
55
55
private static void writePort (final int port ) {
56
56
final File portInfoFile = getInfoFile ();
57
- getWorkingDir ().mkdir ();
58
57
try (BufferedWriter out = new BufferedWriter (new FileWriter (portInfoFile ))) {
59
- out .append (Integer .toString (port ));
58
+ out .append (Integer .toString (port )).append ('\n' );
59
+ out .flush ();
60
60
} catch (IOException e ) {
61
61
System .err .println ("Cannot write port details to " + portInfoFile );
62
62
e .printStackTrace ();
@@ -77,8 +77,9 @@ private static int readPort() throws IOException {
77
77
}
78
78
79
79
private static File getInfoFile () {
80
- File idrisjvmWorkDir = getWorkingDir ();
81
- return new File (idrisjvmWorkDir , ".assembler" );
80
+ File workingDir = getWorkingDir ();
81
+ getWorkingDir ().mkdir ();
82
+ return new File (workingDir , ".assembler" );
82
83
}
83
84
84
85
private static int parseIntWithDefault (String portStr , int dflt ) {
@@ -91,7 +92,7 @@ private static int parseIntWithDefault(String portStr, int dflt) {
91
92
92
93
private static File getWorkingDir () {
93
94
final String userHome = System .getProperty ("user.home" );
94
- return new File (userHome , ".idrisjvm " );
95
+ return new File (userHome , ".jvm-assembler " );
95
96
}
96
97
97
98
private static int getPort (final Server jettyServer ) {
0 commit comments