[Backport 7.x] Fix integration test (#1336)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
dd8ee9056b
commit
18b62b41aa
@ -279,20 +279,26 @@ function build (opts = {}) {
|
|||||||
// eg: 'Basic ${auth}' we search the stahed value 'auth'
|
// eg: 'Basic ${auth}' we search the stahed value 'auth'
|
||||||
// and the resulting value will be 'Basic valueOfAuth'
|
// and the resulting value will be 'Basic valueOfAuth'
|
||||||
if (typeof val === 'string' && val.includes('${')) {
|
if (typeof val === 'string' && val.includes('${')) {
|
||||||
const start = val.indexOf('${')
|
while (obj[key].includes('${')) {
|
||||||
const end = val.indexOf('}', val.indexOf('${'))
|
const val = obj[key]
|
||||||
const stashedKey = val.slice(start + 2, end)
|
const start = val.indexOf('${')
|
||||||
const stashed = stash.get(stashedKey)
|
const end = val.indexOf('}', val.indexOf('${'))
|
||||||
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
|
const stashedKey = val.slice(start + 2, end)
|
||||||
|
const stashed = stash.get(stashedKey)
|
||||||
|
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// handle json strings, eg: '{"hello":"$world"}'
|
// handle json strings, eg: '{"hello":"$world"}'
|
||||||
if (typeof val === 'string' && val.includes('"$')) {
|
if (typeof val === 'string' && val.includes('"$')) {
|
||||||
const start = val.indexOf('"$')
|
while (obj[key].includes('"$')) {
|
||||||
const end = val.indexOf('"', start + 1)
|
const val = obj[key]
|
||||||
const stashedKey = val.slice(start + 2, end)
|
const start = val.indexOf('"$')
|
||||||
const stashed = '"' + stash.get(stashedKey) + '"'
|
const end = val.indexOf('"', start + 1)
|
||||||
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
|
const stashedKey = val.slice(start + 2, end)
|
||||||
|
const stashed = '"' + stash.get(stashedKey) + '"'
|
||||||
|
obj[key] = val.slice(0, start) + stashed + val.slice(end + 1)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// if the key value is a string, and the string includes '$'
|
// if the key value is a string, and the string includes '$'
|
||||||
|
|||||||
Reference in New Issue
Block a user