feat: include the compiler exe and use working relative filepath
This commit is contained in:
@@ -34,6 +34,7 @@ function deactivate() {
|
||||
|
||||
function generateErrors(code) {
|
||||
try {
|
||||
console.log("generating errors")
|
||||
const fs = require('fs');
|
||||
const tmpFilePath = '/tmp/temp_wacc_file.wacc';
|
||||
fs.writeFileSync(tmpFilePath, code);
|
||||
@@ -41,8 +42,11 @@ function generateErrors(code) {
|
||||
let output;
|
||||
try {
|
||||
// currently only works if the wacc compiler exe is in the parent directory
|
||||
output = execSync(`../wacc_exe ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' });
|
||||
const waccExePath = `${__dirname}/wacc_exe`;
|
||||
output = execSync(`${waccExePath} ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' });
|
||||
} catch (err) {
|
||||
console.log("this aint working buddy")
|
||||
console.log(err)
|
||||
output = err.stdout;
|
||||
}
|
||||
let errors = [];
|
||||
|
||||
BIN
wacc-syntax/wacc_exe
Executable file
BIN
wacc-syntax/wacc_exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user