From 23df8ac74740bff51382d2b7fd19945d04e865f1 Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Mon, 29 Nov 2021 19:37:57 +0000
Subject: fixed bug where binaries were built in the wrong directory

---
 src/Compiler/Language.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/Compiler')

diff --git a/src/Compiler/Language.java b/src/Compiler/Language.java
index 3559c37..b433b36 100644
--- a/src/Compiler/Language.java
+++ b/src/Compiler/Language.java
@@ -5,11 +5,8 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.nio.file.Path;
 import java.util.List;
-import java.util.Base64;
 import java.util.Scanner;
 import java.util.ArrayList;
-import java.io.File;
-import java.io.FileNotFoundException;
 
 //Base class for the interpreter
 public class Language {
@@ -39,7 +36,8 @@ public class Language {
             return;
         }
         
-        String outname = args[0].split("\\.(?=[^\\.]+$)")[0];
+        Path initOutPath = Paths.get(args[0]);
+        String outname = initOutPath.getName(initOutPath.getNameCount() - 1).toString().split("\\.(?=[^\\.]+$)")[0];
         ArrayList<String> arrayArgs = new ArrayList<>();
         for (int i = 0; i < args.length; i++) {
             String arg = args[i];
-- 
cgit v1.2.3