buildkite-graph
Advanced tools
Comparing version
@@ -65,6 +65,8 @@ import { KeyValue } from '../key_value'; | ||
* Allows to override the value of a property of the command. | ||
* The override is the name of a environment variable. | ||
* The override needs to follow the syntax for a Buildkite-supported | ||
* environment variable (supporting fallbacks, etc.). | ||
* | ||
* E.g. `withParameterOverride('priority', 'CUSTOM_PRIORITY')` would | ||
* E.g. `withParameterOverride('priority', '${CUSTOM_PRIORITY}')` would | ||
* then yield `priority: ${CUSTOM_PRIORITY}` in the resulting serialization. | ||
* The value is used verbatim. | ||
*/ | ||
@@ -71,0 +73,0 @@ withParameterOverride(key: CommandProperty, value: string): this; |
@@ -196,10 +196,12 @@ "use strict"; | ||
* Allows to override the value of a property of the command. | ||
* The override is the name of a environment variable. | ||
* The override needs to follow the syntax for a Buildkite-supported | ||
* environment variable (supporting fallbacks, etc.). | ||
* | ||
* E.g. `withParameterOverride('priority', 'CUSTOM_PRIORITY')` would | ||
* E.g. `withParameterOverride('priority', '${CUSTOM_PRIORITY}')` would | ||
* then yield `priority: ${CUSTOM_PRIORITY}` in the resulting serialization. | ||
* The value is used verbatim. | ||
*/ | ||
withParameterOverride(key, value) { | ||
(0, ow_1.default)(key, ow_1.default.string.nonEmpty); | ||
(0, ow_1.default)(value, ow_1.default.string.nonEmpty); | ||
(0, ow_1.default)(value, ow_1.default.string.nonEmpty.startsWith('$')); | ||
this.overrides.set(key, value); | ||
@@ -224,3 +226,3 @@ return this; | ||
if (this.overrides.has(key)) { | ||
return ('$' + this.overrides.get(key)); | ||
return this.overrides.get(key); | ||
} | ||
@@ -227,0 +229,0 @@ return value; |
{ | ||
"name": "buildkite-graph", | ||
"version": "5.8.0", | ||
"version": "6.0.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
69062
0.33%1596
0.25%