+13
-25
@@ -21,2 +21,6 @@ // Generated by CoffeeScript 1.3.3 | ||
| String.prototype.endsWith = function(end) { | ||
| return this.indexOf(end) === this.length - end.length; | ||
| }; | ||
| print = require('util').print; | ||
@@ -88,3 +92,3 @@ | ||
| Oven.prototype._validateConfig = function() { | ||
| var mode_name, set, set_name, _ref1, _results; | ||
| var mode_name, set, set_name, _ref1; | ||
| if (!_.size(this.config)) { | ||
@@ -94,3 +98,2 @@ console.log("warning: an empty config file was loaded: " + config_pathed_filename); | ||
| _ref1 = this.config; | ||
| _results = []; | ||
| for (set_name in _ref1) { | ||
@@ -101,16 +104,9 @@ set = _ref1[set_name]; | ||
| } | ||
| _results.push((function() { | ||
| var _results1; | ||
| _results1 = []; | ||
| for (mode_name in set) { | ||
| if (mode_name.startsWith('_') && !_.contains(INTERNAL_MODES, mode_name)) { | ||
| _results1.push(console.log("warning: mode name '" + mode_name + "' is not a recognized internal mode. It will be skipped.")); | ||
| } else { | ||
| _results1.push(void 0); | ||
| } | ||
| for (mode_name in set) { | ||
| if (mode_name.startsWith('_') && !_.contains(INTERNAL_MODES, mode_name)) { | ||
| console.log("warning: mode name '" + mode_name + "' is not a recognized internal mode. It will be skipped."); | ||
| } | ||
| return _results1; | ||
| })()); | ||
| } | ||
| } | ||
| return _results; | ||
| return this; | ||
| }; | ||
@@ -243,8 +239,2 @@ | ||
| args = []; | ||
| if (options.watch) { | ||
| args.push('-w'); | ||
| } | ||
| if (set_options.bare) { | ||
| args.push('-b'); | ||
| } | ||
| if (set_options.join) { | ||
@@ -268,7 +258,5 @@ args.push('-j'); | ||
| } | ||
| command_queue.push(new eb.command.Coffee(args, { | ||
| cwd: file_group.directory, | ||
| compress: set_options.compress, | ||
| test: options.test | ||
| })); | ||
| command_queue.push(new eb.command.Coffee(args, _.defaults(_.defaults({ | ||
| cwd: file_group.directory | ||
| }, set_options), options))); | ||
| } | ||
@@ -275,0 +263,0 @@ eb.utils.extractSetCommands(set_options, command_queue, this.config_dir); |
@@ -21,2 +21,6 @@ // Generated by CoffeeScript 1.3.3 | ||
| String.prototype.endsWith = function(end) { | ||
| return this.indexOf(end) === this.length - end.length; | ||
| }; | ||
| if (!eb) { | ||
@@ -264,3 +268,3 @@ eb = {}; | ||
| Copy.prototype.target = function() { | ||
| var package_desc, package_desc_path, source_dir, source_dir_components, target; | ||
| var extension, package_desc, package_desc_path, source_dir, source_dir_components, target; | ||
| target = this.args[this.args.length - 1]; | ||
@@ -281,9 +285,9 @@ if (this.isVersioned()) { | ||
| package_desc = require(package_desc_path); | ||
| if (target.endsWith('.min.js')) { | ||
| target = target.replace(/.min.js$/, "-" + package_desc.version + ".min.js"); | ||
| } else if (target.endsWith('-min.js')) { | ||
| target = target.replace(/-min.js$/, "-" + package_desc.version + "-min.js"); | ||
| } else { | ||
| target = target.replace(/.js$/, "-" + package_desc.version + ".js"); | ||
| extension = path.extname(target); | ||
| if (target.endsWith(".min" + extension)) { | ||
| extension = ".min" + extension; | ||
| } else if (target.endsWith("-min" + extension)) { | ||
| extension = "-min" + extension; | ||
| } | ||
| target = target.replace(extension, "-" + package_desc.version + extension); | ||
| } | ||
@@ -445,5 +449,2 @@ return target; | ||
| source_files = _.clone(this.args); | ||
| if ((index = _.indexOf(source_files, '-w')) >= 0) { | ||
| source_files.splice(index, 1); | ||
| } | ||
| eb.utils.argsRemoveOutput(source_files); | ||
@@ -495,3 +496,3 @@ if ((index = _.indexOf(source_files, '-j')) >= 0) { | ||
| Coffee.prototype.run = function(options, callback) { | ||
| var args, compile, cwd, notify, watchDirectory, watchFile, watchFiles, watch_index, watch_list, watchers, | ||
| var args, compile, cwd, notify, watchDirectory, watchFile, watchFiles, watch_list, watchers, | ||
| _this = this; | ||
@@ -514,5 +515,3 @@ if (options == null) { | ||
| output_names = _this.pathedTargets(); | ||
| if (_this.isCompressed() || (_this.runsTests() && _this.already_run)) { | ||
| post_build_queue = new eb.command.Queue(); | ||
| } | ||
| post_build_queue = new eb.command.Queue(); | ||
| for (_i = 0, _len = output_names.length; _i < _len; _i++) { | ||
@@ -538,2 +537,7 @@ source_name = output_names[_i]; | ||
| } | ||
| if (_this.command_options.wrapper) { | ||
| post_build_queue.push(new eb.command.Wrap(_this.command_options.wrapper, pathed_build_name, { | ||
| cwd: _this.command_options.cwd | ||
| })); | ||
| } | ||
| if (_this.isCompressed()) { | ||
@@ -549,19 +553,14 @@ post_build_queue.push(new eb.command.RunCommand('uglifyjs', ['-o', eb.utils.compressedName(pathed_build_name), pathed_build_name], null)); | ||
| _this.already_run = true; | ||
| if (post_build_queue) { | ||
| return post_build_queue.run(options, function() { | ||
| return typeof callback === "function" ? callback(code, _this) : void 0; | ||
| }); | ||
| } else { | ||
| return typeof callback === "function" ? callback(0, _this) : void 0; | ||
| } | ||
| return post_build_queue.run(options, function() { | ||
| return typeof callback === "function" ? callback(code, _this) : void 0; | ||
| }); | ||
| }; | ||
| watch_index = _.indexOf(this.args, '-w'); | ||
| if (watch_index >= 0) { | ||
| args = _.clone(this.args); | ||
| args.splice(watch_index, 1); | ||
| if (this.command_options.watch) { | ||
| watch_list = this.sourceFiles(); | ||
| watchers = {}; | ||
| } else { | ||
| args = this.args; | ||
| } | ||
| args = _.clone(this.args); | ||
| if (this.command_options.bare || this.command_options.wrapper) { | ||
| args.unshift('-b'); | ||
| } | ||
| cwd = eb.utils.extractCWD(this.command_options); | ||
@@ -651,2 +650,38 @@ watchFile = function(file) { | ||
| eb.command.Wrap = (function() { | ||
| function Wrap(wrapper, file, command_options) { | ||
| this.wrapper = wrapper; | ||
| this.file = file; | ||
| this.command_options = command_options; | ||
| } | ||
| Wrap.prototype.run = function(options, callback) { | ||
| var file_content, pathed_file, pathed_wrapper, wrapped_file, wrapper_content; | ||
| if (options == null) { | ||
| options = {}; | ||
| } | ||
| if (options.preview || options.verbose) { | ||
| console.log("wrap " + this.file + " with " + this.wrapper); | ||
| if (options.preview) { | ||
| if (typeof callback === "function") { | ||
| callback(0, this); | ||
| } | ||
| return; | ||
| } | ||
| } | ||
| pathed_wrapper = mb.resolveSafe(this.wrapper, this.command_options); | ||
| pathed_file = mb.resolveSafe(this.file, this.command_options); | ||
| wrapper_content = fs.readFileSync(pathed_wrapper, 'utf8'); | ||
| file_content = fs.readFileSync(pathed_file, 'utf8'); | ||
| wrapped_file = wrapper_content.toString().replace("'__REPLACE__'", file_content); | ||
| return fs.writeFile(pathed_file, wrapped_file, 'utf8', function() { | ||
| return callback(0); | ||
| }); | ||
| }; | ||
| return Wrap; | ||
| })(); | ||
| eb.command.RunTest = (function() { | ||
@@ -917,3 +952,3 @@ | ||
| if (!existsSync(pathed_filename)) { | ||
| console.log("skipping publish_npm for: " + package_desc_path + " (main file missing...do you need to build it?)"); | ||
| console.log("skipping publish_nuget for: " + package_desc_path + " (main file missing...do you need to build it?)"); | ||
| if (typeof callback === "function") { | ||
@@ -920,0 +955,0 @@ callback(1); |
@@ -61,14 +61,15 @@ // Generated by CoffeeScript 1.3.3 | ||
| if (command_name === 'cp') { | ||
| _results.push(queue.push(new eb.command.Copy(command_args, { | ||
| queue.push(new eb.command.Copy(command_args, { | ||
| cwd: cwd | ||
| }))); | ||
| })); | ||
| } else if (command_name === 'cat') { | ||
| _results.push(queue.push(new eb.command.Concatenate(command_args, { | ||
| queue.push(new eb.command.Concatenate(command_args, { | ||
| cwd: cwd | ||
| }))); | ||
| })); | ||
| } else { | ||
| _results.push(queue.push(new eb.command.RunCommand(command_name, command_args, { | ||
| queue.push(new eb.command.RunCommand(command_name, command_args, { | ||
| cwd: cwd | ||
| }))); | ||
| })); | ||
| } | ||
| _results.push(this); | ||
| } | ||
@@ -75,0 +76,0 @@ return _results; |
+1
-1
@@ -30,3 +30,3 @@ { | ||
| }, | ||
| "version" : "0.1.7" | ||
| "version" : "0.1.8" | ||
| } |
+2
-2
@@ -154,3 +154,3 @@ [](http://travis-ci.org/kmalakoff/easy-bake) | ||
| "coffee-script": ">=1.3.3", | ||
| "easy-bake": "0.1.6" | ||
| "easy-bake": "0.1.7" | ||
| }, | ||
@@ -209,3 +209,3 @@ ``` | ||
| node_js: | ||
| - 0.7 # development version of 0.8, may be unstable | ||
| - 0.8 | ||
@@ -212,0 +212,0 @@ before_script: |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
697590
0.11%1685
1.02%16
6.67%