@@ -54,9 +54,9 @@ private static void startServer() throws Exception {
5454
5555 private static void writePort (final int port ) {
5656 final File portInfoFile = getInfoFile ();
57- getWorkingDir ().mkdir ();
5857 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 ();
6060 } catch (IOException e ) {
6161 System .err .println ("Cannot write port details to " + portInfoFile );
6262 e .printStackTrace ();
@@ -77,8 +77,9 @@ private static int readPort() throws IOException {
7777 }
7878
7979 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" );
8283 }
8384
8485 private static int parseIntWithDefault (String portStr , int dflt ) {
@@ -91,7 +92,7 @@ private static int parseIntWithDefault(String portStr, int dflt) {
9192
9293 private static File getWorkingDir () {
9394 final String userHome = System .getProperty ("user.home" );
94- return new File (userHome , ".idrisjvm " );
95+ return new File (userHome , ".jvm-assembler " );
9596 }
9697
9798 private static int getPort (final Server jettyServer ) {
0 commit comments