Skip to content

Commit

Permalink
Fix compilation problem
Browse files Browse the repository at this point in the history
Merge pull request #27 from haroldo-ok/fix-compilation-problem

The released version 0.2.3 had a bug where it was looking for 8bit-Unity on the wrong directory, preventing the compilation from working at all.

This fixes #26 and bumps version to 0.2.4.
haroldo-ok authored Jun 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 73b1d45 + 9f88dd7 commit dfacda2
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions blockly/apps/blocklyduino/blockly_helper.js
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ async function compile() {
} catch (err) {
console.error(err);
printToConsole('Compilation failed!');
printToConsole(err);
topbar.hide();
return Promise.reject();
};
@@ -131,6 +132,12 @@ function saveCode() {

}

const isExistingFile = async filePath => {
return new Promise((resolve, reject) => {
fs.access(filePath, err => resolve(!err));
});
}

const makeDirIfNotExists = async filePath => {
return new Promise((resolve, reject) => {
fs.mkdir(filePath, err => {
@@ -158,6 +165,11 @@ const platformToRun = () => document.getElementById('platformToRun').value
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));

const createTargetDirectories = async () => {
const frameworkPath = config.fileName('8bitUnity', '');
if (!await isExistingFile(frameworkPath)) {
throw new Error(`Couldn't find 8bit-Unity at '${frameworkPath}'; please check if the installation is correct.`);
}

const targetPath = config.fileName('8bitUnity', 'projects/' + project.current.name + '/');
const subDirs = ['bitmaps', 'chunks', 'music', 'sprites', 'src']
.map(name => `${targetPath}${name}/`);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BlocklyVN8bit",
"version": "0.2.3",
"version": "0.2.4",
"description": "Uses blockly to generate visual novels for 8bit-Unity",
"main": "main.js",
"scripts": {

0 comments on commit dfacda2

Please sign in to comment.