Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix for google-closure-compiler. fixes #156
Browse files Browse the repository at this point in the history
  • Loading branch information
igorklopov committed Jul 29, 2017
1 parent 2965678 commit 3ffa4fc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dictionary/google-closure-compiler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = {
pkg: {
assets: [
'compiler.jar'
],
patches: {
'lib/node/closure-compiler.js': [
'require.resolve(\'../../compiler.jar\')',
'require(\'path\').join(require(\'path\').dirname(process.execPath), \'compiler.jar\')'
]
}
}
};
1 change: 1 addition & 0 deletions test/test-79-npm/drivelist/drivelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var fs = require('fs');
var path = require('path');
// TODO move to meta.js.packages
var mkdirp = require('../../../node_modules/mkdirp');
var rimraf = require('../../../node_modules/rimraf');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

var fs = require('fs');
var path = require('path');

var Compiler = require('google-closure-compiler').compiler;
var packagePath = path.dirname(require.resolve('google-closure-compiler'));
var jarPath = path.join(packagePath, 'compiler.jar');

if (process.pkg) {
fs.writeFileSync(Compiler.JAR_PATH, fs.readFileSync(jarPath));
fs.unlinkSync(Compiler.JAR_PATH);
}

console.log('ok');

// TODO try to avoid storing assets here and in drive list
// figure out another way of referring to process.execPath directory
1 change: 1 addition & 0 deletions test/test-79-npm/google-closure-compiler/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }

0 comments on commit 3ffa4fc

Please sign in to comment.