mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Append to script instead read then write
This commit is contained in:
parent
63c7766312
commit
c2c73b16c1
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -455,7 +455,7 @@ async function getScript(filename, version, os_version) {
|
|||||||
const coverage_driver = await utils.getInput('coverage', false);
|
const coverage_driver = await utils.getInput('coverage', false);
|
||||||
const tools_csv = await utils.getInput('tools', false);
|
const tools_csv = await utils.getInput('tools', false);
|
||||||
const script_path = path_1.default.join(__dirname, '../src/scripts', filename);
|
const script_path = path_1.default.join(__dirname, '../src/scripts', filename);
|
||||||
let script = fs_1.default.readFileSync(script_path, 'utf8');
|
let script = '\n';
|
||||||
if (extension_csv) {
|
if (extension_csv) {
|
||||||
script += await extensions.addExtension(extension_csv, version, os_version);
|
script += await extensions.addExtension(extension_csv, version, os_version);
|
||||||
}
|
}
|
||||||
@ -468,7 +468,7 @@ async function getScript(filename, version, os_version) {
|
|||||||
}
|
}
|
||||||
script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
|
script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
|
||||||
script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
|
script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
|
||||||
fs_1.default.writeFileSync(script_path, script, { mode: 0o755 });
|
fs_1.default.appendFileSync(script_path, script, { mode: 0o755 });
|
||||||
return script_path;
|
return script_path;
|
||||||
}
|
}
|
||||||
exports.getScript = getScript;
|
exports.getScript = getScript;
|
||||||
|
@ -28,7 +28,7 @@ export async function getScript(
|
|||||||
const coverage_driver: string = await utils.getInput('coverage', false);
|
const coverage_driver: string = await utils.getInput('coverage', false);
|
||||||
const tools_csv: string = await utils.getInput('tools', false);
|
const tools_csv: string = await utils.getInput('tools', false);
|
||||||
const script_path = path.join(__dirname, '../src/scripts', filename);
|
const script_path = path.join(__dirname, '../src/scripts', filename);
|
||||||
let script: string = fs.readFileSync(script_path, 'utf8');
|
let script = '\n';
|
||||||
if (extension_csv) {
|
if (extension_csv) {
|
||||||
script += await extensions.addExtension(extension_csv, version, os_version);
|
script += await extensions.addExtension(extension_csv, version, os_version);
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ export async function getScript(
|
|||||||
script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
|
script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
|
||||||
script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
|
script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
|
||||||
|
|
||||||
fs.writeFileSync(script_path, script, {mode: 0o755});
|
fs.appendFileSync(script_path, script, {mode: 0o755});
|
||||||
|
|
||||||
return script_path;
|
return script_path;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user