do not call install on sm update
This commit is contained in:
parent
6cfe9617c2
commit
2b08cebd56
2 changed files with 30 additions and 21 deletions
49
install.js
49
install.js
|
|
@ -33,27 +33,36 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var buildAce = require("./Makefile.dryice").buildAce;
|
||||
|
||||
var fs = require("fs");
|
||||
|
||||
var ACE_HOME = __dirname;
|
||||
|
||||
try {
|
||||
var aceProject = {
|
||||
roots: [
|
||||
ACE_HOME + '/lib',
|
||||
ACE_HOME + '/demo'
|
||||
],
|
||||
textPluginPattern: /^ace\/requirejs\/text!/
|
||||
};
|
||||
buildAce(aceProject, {
|
||||
compress: false,
|
||||
noconflict: false,
|
||||
suffix: "",
|
||||
compat: true,
|
||||
name: "ace"
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("--- Ace Build error ---");
|
||||
console.log(e);
|
||||
process.exit(0);
|
||||
function getVersion(path) {
|
||||
if (fs.existsSync(path + "/.git-ref"))
|
||||
return fs.readFileSync(path + "/.git-ref", "utf8");
|
||||
if (fs.existsSync(path + "/.git/ORIG_HEAD"))
|
||||
return fs.readFileSync(path + "/.git/ORIG_HEAD", "utf8");
|
||||
}
|
||||
|
||||
if (process.argv.indexOf("-c") > 0) try {
|
||||
var version = getVersion(ACE_HOME);
|
||||
var oldVersion = getVersion(ACE_HOME + "/build");
|
||||
if (version && oldVersion == version) {
|
||||
console.log("ace build is up to date");
|
||||
process.exit(0);
|
||||
}
|
||||
fs.writeFileSync(ACE_HOME + "/build/.git-ref", version, "utf8");
|
||||
} catch (e) {}
|
||||
|
||||
try {
|
||||
buildAce({
|
||||
compress: false,
|
||||
noconflict: false,
|
||||
suffix: "",
|
||||
name: "ace"
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("--- Ace Build error ---");
|
||||
console.log(e);
|
||||
process.exit(0);
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": "node lib/ace/test/all.js",
|
||||
"postinstall": "node ./install.js"
|
||||
"postinstall": "node ./install.js -c"
|
||||
},
|
||||
"config": {
|
||||
"github.com/sourcemint/bundler-js/0/-meta/config/0": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue