dockerlint
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -252,36 +252,31 @@ // Generated by CoffeeScript 1.12.4 | ||
exports.env = function(rules) { | ||
var argument, env, eq_form, i, j, k, l, len, len1, len2, p, pair, ref, ref1, rule; | ||
env = this.getAll('ENV', rules); | ||
for (j = 0, len = env.length; j < len; j++) { | ||
rule = env[j]; | ||
var argument, env, environs, j, k, l, len, len1, len2, p, pair, ref, ref1, rule; | ||
environs = this.getAll('ENV', rules); | ||
for (j = 0, len = environs.length; j < len; j++) { | ||
rule = environs[j]; | ||
ref = rule["arguments"]; | ||
for (k = 0, len1 = ref.length; k < len1; k++) { | ||
argument = ref[k]; | ||
eq_form = false; | ||
i = 0; | ||
ref1 = argument.split(' '); | ||
for (l = 0, len2 = ref1.length; l < len2; l++) { | ||
pair = ref1[l]; | ||
p = pair.split(/(\w+)=([^\s]+)/); | ||
if (i === 0) { | ||
if (p[1]) { | ||
eq_form = true; | ||
} | ||
if (argument.split(' ')[0].match(/(\w+)=([^\s]+)/)) { | ||
ref1 = argument.split(' '); | ||
for (l = 0, len2 = ref1.length; l < len2; l++) { | ||
pair = ref1[l]; | ||
p = pair.split(/(\w+)=([^\s]+)/); | ||
exports.env['$' + p[1]] = p[2]; | ||
} | ||
if ((!p[1] && eq_form) || (p[1] && !eq_form)) { | ||
utils.log('ERROR', "ENV cannot mix the two formats for declaring variables line " + rule.line); | ||
} else { | ||
env = argument.match(/^(\S+)\s(.*)/); | ||
if (env) { | ||
env = env.slice(1); | ||
} else { | ||
utils.log('ERROR', "ENV invalid format " + rule["arguments"] + " on line " + rule.line); | ||
return 'failed'; | ||
} | ||
i++; | ||
if (p[1]) { | ||
exports.env['$' + p[1]] = p[2]; | ||
if (env[0] && env[1]) { | ||
exports.env['$' + env[0]] = env[1]; | ||
} else { | ||
utils.log('ERROR', "ENV invalid format " + rule["arguments"] + " on line " + rule.line); | ||
return 'failed'; | ||
} | ||
} | ||
if (argument.match(/(\w+)=([^\s]+)/)) { | ||
continue; | ||
} | ||
env = argument.match(/^(\S+)\s(.*)/).slice(1); | ||
if (env[0] && env[1]) { | ||
exports.env['$' + env[0]] = env[1]; | ||
} | ||
} | ||
@@ -288,0 +283,0 @@ } |
{ | ||
"name": "dockerlint", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Linting for Dockerfiles", | ||
@@ -5,0 +5,0 @@ "main": "bin/dockerlint", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35565
525