Comparing version 3.1.1 to 3.1.2
{ | ||
"name": "env-ci", | ||
"description": "Get environment variables exposed by CI services", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"author": "Pierre Vanduynslager (https://github.com/pvdlg)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -8,10 +8,17 @@ // https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters | ||
const getProperties = env => { | ||
const properties = env.TEAMCITY_BUILD_PROPERTIES_FILE | ||
const buildProperties = env.TEAMCITY_BUILD_PROPERTIES_FILE | ||
? javaProperties.of(env.TEAMCITY_BUILD_PROPERTIES_FILE) | ||
: undefined; | ||
const configFile = buildProperties ? buildProperties.get('teamcity.configuration.properties.file') : undefined; | ||
const configProperties = configFile ? javaProperties.of(configFile) : configFile; | ||
return Object.keys(PROPERTIES_MAPPING).reduce((result, key) => { | ||
const property = properties ? properties.get(PROPERTIES_MAPPING[key]) : undefined; | ||
return Object.assign(result, {[key]: typeof property === 'undefined' ? env[PROPERTIES_MAPPING[key]] : property}); | ||
}, {}); | ||
return Object.keys(PROPERTIES_MAPPING).reduce( | ||
(result, key) => | ||
Object.assign(result, { | ||
[key]: | ||
(buildProperties ? buildProperties.get(PROPERTIES_MAPPING[key]) : undefined) || | ||
(configProperties ? configProperties.get(PROPERTIES_MAPPING[key]) : undefined), | ||
}), | ||
{} | ||
); | ||
}; | ||
@@ -18,0 +25,0 @@ |
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
36728
553