Permalink
Browse files

beautifying app.js hinges on the deploy type now, not the alloy.json

  • Loading branch information...
tonylukasavage committed Jun 15, 2012
1 parent 7281d5d commit e464f457a0051adaeb1ea77652f41ca9d38c9f07
Showing with 2 additions and 4 deletions.
  1. +2 −4 Alloy/alloy.js
View
@@ -355,7 +355,7 @@ function compile(args)
JS + "\n" +
JS_EPILOG;
- var beautify = alloyConfig.compiler ? alloyConfig.compiler.beautify : false;
+ var beautify = program.config.deploytype === 'development' ? true : false;
var ast = jsp.parse(code); // parse code and get the initial AST
ast = pro.ast_mangle(ast,{except:['Ti','Titanium'],defines:defines}); // get a new AST with mangled names
@@ -948,9 +948,7 @@ function newproject(args)
// write a default compiler configuration
var defaultConfig = {
- compiler: {
- beautify:true
- }
+ compiler: {}
};
fs.writeFileSync(path.join(outputPath,'alloy.json'),U.stringifyJSON(defaultConfig));

2 comments on commit e464f45

@jhaynie

This comment has been minimized.

Show comment Hide comment
@jhaynie

jhaynie Jun 15, 2012

Contributor

i'm sorry, i didn't explain this well enough. i was asking for this to be:

var beautify = alloyConfig.compiler ? alloyConfig.compiler.beautify : program.config.deploytype === 'development' ? true : false;
Contributor

jhaynie replied Jun 15, 2012

i'm sorry, i didn't explain this well enough. i was asking for this to be:

var beautify = alloyConfig.compiler ? alloyConfig.compiler.beautify : program.config.deploytype === 'development' ? true : false;
@tonylukasavage

This comment has been minimized.

Show comment Hide comment
@tonylukasavage

tonylukasavage Jun 15, 2012

Contributor

done, with a slight change to prevent undefined values from sneaking through:

var beautify = alloyConfig.compiler && typeof alloyConfig.compiler.beautify !== 'undefined' ? alloyConfig.compiler.beautify : program.config.deploytype === 'development' ? true : false;

2e24128

Contributor

tonylukasavage replied Jun 15, 2012

done, with a slight change to prevent undefined values from sneaking through:

var beautify = alloyConfig.compiler && typeof alloyConfig.compiler.beautify !== 'undefined' ? alloyConfig.compiler.beautify : program.config.deploytype === 'development' ? true : false;

2e24128

Please sign in to comment.