Created
April 4, 2017 08:20
-
-
Save ilayaperumalg/ef37276e39410bb47a2ba75e2cf9ab58 to your computer and use it in GitHub Desktop.
Check for invalid lines (newline, commented entries) from deployment properties file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ui/app/scripts/stream/controllers/definition-deploy.js b/ui/app/scripts/stream/controllers/definition-deploy.js | |
index 02cace4..416d6fd 100644 | |
--- a/ui/app/scripts/stream/controllers/definition-deploy.js | |
+++ b/ui/app/scripts/stream/controllers/definition-deploy.js | |
@@ -64,15 +64,17 @@ define([], function () { | |
if (properties) { | |
propertiesAsMap = {}; | |
for (let prop of properties) { | |
- var keyValue = prop.split('='); | |
- if (keyValue.length===2) { | |
- propertiesAsMap[keyValue[0]] = keyValue[1]; | |
- } | |
- else { | |
- utils.$log.warn('Invalid deployment property "' + prop +'" must contain a single "=".'); | |
- $scope.deployDefinitionForm.deploymentProperties.$setValidity('invalidDeploymentProperties', false); | |
- return; | |
- } | |
+ if (prop && prop.length > 0 && !prop.startsWith('#')) { | |
+ var keyValue = prop.split('='); | |
+ if (keyValue.length===2) { | |
+ propertiesAsMap[keyValue[0]] = keyValue[1]; | |
+ } | |
+ else { | |
+ utils.$log.warn('Invalid deployment property "' + prop +'" must contain a single "=".'); | |
+ $scope.deployDefinitionForm.deploymentProperties.$setValidity('invalidDeploymentProperties', false); | |
+ return; | |
+ } | |
+ } | |
} | |
} | |
$scope.deployDefinitionForm.deploymentProperties.$setValidity('invalidDeploymentProperties', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment