mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Do not quote ini values with error constants
This commit is contained in:
parent
1ecc5fdca3
commit
0cc14f65a2
@ -97,12 +97,9 @@ describe('Utils tests', () => {
|
||||
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||
const script_path: string = path.join(runner_dir, 'test.sh');
|
||||
await utils.writeScript('test.sh', testString);
|
||||
await fs.readFile(
|
||||
script_path,
|
||||
function (error: Error | null, data: Buffer) {
|
||||
expect(testString).toBe(data.toString());
|
||||
}
|
||||
);
|
||||
fs.readFile(script_path, function (error: Error | null, data: Buffer) {
|
||||
expect(testString).toBe(data.toString());
|
||||
});
|
||||
await cleanup(script_path);
|
||||
});
|
||||
|
||||
@ -135,6 +132,17 @@ describe('Utils tests', () => {
|
||||
'b=3, 4',
|
||||
'c=5'
|
||||
]);
|
||||
expect(await utils.CSVArray('\'a=1,2\', "b=3, 4", c=5, d=~e~')).toEqual([
|
||||
'a=1,2',
|
||||
'b=3, 4',
|
||||
'c=5',
|
||||
"d='~e~'"
|
||||
]);
|
||||
expect(await utils.CSVArray('a=\'1,2\', b="3, 4", c=5')).toEqual([
|
||||
'a=1,2',
|
||||
'b=3, 4',
|
||||
'c=5'
|
||||
]);
|
||||
expect(await utils.CSVArray('')).toEqual([]);
|
||||
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||
});
|
||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1285,7 +1285,7 @@ async function CSVArray(values_csv) {
|
||||
return value
|
||||
.trim()
|
||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||
.replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'");
|
||||
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
|
||||
return value
|
||||
.trim()
|
||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||
.replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'");
|
||||
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user