Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unlink #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
*/.svn/*
*/*/.svn/*
node_modules/
package-lock.json

.DS_Store
.DS_Store
8 changes: 4 additions & 4 deletions bin/commands/distil.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function parseCommand (args) {
for (i = 0, l = files.length; i < l; i++) {
outstanding++;

distilFile(files[i][0], files[i][1], args.switches, function () {
distilFile(files[i][0], files[i][1], args.switches, function () {
if (!--outstanding) success();
});

Expand Down Expand Up @@ -161,13 +161,13 @@ function compile (filename, switches, callback) {
if (err) {
errPart = err.message.split(/:\s?/);
if (errPart[1] != 'luac') throw err;

console.error(COLORS.RED + 'Luac compile error in file ' + errPart[2] + ' on line ' + errPart[3] + ':\n\t' + errPart[4] + COLORS.RESET);
return;
}

callback(fs.readFileSync(luacFilename, 'binary').toString());
fs.unlink(luacFilename);
fs.unlinkSync(luacFilename);
});
}

Expand All @@ -176,7 +176,7 @@ function compile (filename, switches, callback) {

function distil (source, switches, callback) {
compile(source, switches, function (bytecode) {

var parser = new Parser(),
config = {
stripDebugging: switches.stripDebugging,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"url": "https://github.com/gamesys/moonshine/issues"
},
"dependencies": {
"express": "3.2.5",
"socket.io": "0.9.14"
"express": "^3.21.2",
"socket.io": "^4.1.2"
}
}
}
11 changes: 5 additions & 6 deletions vm/build/build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* Note: Requires Google Closure Compiler to be installed in /usr/local/bin
* https://developers.google.com/closure/compiler/
*
*
* Examples:
* ./build Builds JavaScript lib files.
* ./build -swc Builds JavaScript and ActionScript lib files.
Expand Down Expand Up @@ -66,7 +66,7 @@ var switches = getSwitches(process.argv),
'../src/jit.js',
'../src/lib.js',
'../src/utils.js',
'../src/output.js'
'../src/output.js'
],
OUTPUT_FILENAME = '../moonshine.js',
HEADER_FILENAME = './header.js',
Expand Down Expand Up @@ -165,7 +165,7 @@ function minifyLibrary () {
appendFile(output, filename);

fs.closeSync(output);
fs.unlink(filename);
fs.unlinkSync(filename);

console.log('File written: ' + MINIFIED_OUTPUT_FILENAME);
if (switches['-module']) buildModule();
Expand All @@ -190,7 +190,7 @@ function buildSWC () {

exec(cmd, function (err) {
if (err) throw err;
fs.unlink(filename);
fs.unlinkSync(filename);

console.log('File written: ' + SWC_OUTPUT_FILENAME);
});
Expand All @@ -210,8 +210,7 @@ function buildModule () {
fs.writeSync(output, 'define(function(require,exports,module){\n');
appendFile(output, MINIFIED_OUTPUT_FILENAME);
fs.writeSync(output, '\n});');

fs.closeSync(output);
console.log('File written: ' + MODULE_FILENAME);
}