mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2026-02-04 06:18:09 +00:00
Add permission bit when writting the wrapper
This commit is contained in:
parent
320df87442
commit
315ab497cf
2 changed files with 3 additions and 3 deletions
|
|
@ -87,7 +87,7 @@ async function installWrapper (pathToCLI) {
|
||||||
wrapperContent[0] = `#!${process.argv[0]}`;
|
wrapperContent[0] = `#!${process.argv[0]}`;
|
||||||
|
|
||||||
core.debug(`Writing updated wrapper to ${target}.`);
|
core.debug(`Writing updated wrapper to ${target}.`);
|
||||||
await fs.writeFile(target, wrapperContent.join('\n'));
|
await fs.writeFile(target, wrapperContent.join('\n'), { mode: 0o755 });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
core.error(`Unable to copy ${source} to ${target}.`);
|
core.error(`Unable to copy ${source} to ${target}.`);
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,7 @@ describe('Setup Terraform', () => {
|
||||||
|
|
||||||
expect(ioMv).toHaveBeenCalledWith(`file${path.sep}terraform`, `file${path.sep}terraform-bin`);
|
expect(ioMv).toHaveBeenCalledWith(`file${path.sep}terraform`, `file${path.sep}terraform-bin`);
|
||||||
expect(fsReadFile).toHaveBeenCalledWith(wrapperPath, 'utf8');
|
expect(fsReadFile).toHaveBeenCalledWith(wrapperPath, 'utf8');
|
||||||
expect(fsWriteFile).toHaveBeenCalledWith(`file${path.sep}terraform`, expect.any(String));
|
expect(fsWriteFile).toHaveBeenCalledWith(`file${path.sep}terraform`, expect.any(String), { mode: 0o755 });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('installs wrapper on windows', async () => {
|
test('installs wrapper on windows', async () => {
|
||||||
|
|
@ -660,6 +660,6 @@ describe('Setup Terraform', () => {
|
||||||
|
|
||||||
expect(ioMv).toHaveBeenCalledWith(`file${path.sep}terraform.exe`, `file${path.sep}terraform-bin.exe`);
|
expect(ioMv).toHaveBeenCalledWith(`file${path.sep}terraform.exe`, `file${path.sep}terraform-bin.exe`);
|
||||||
expect(fsReadFile).toHaveBeenCalledWith(wrapperPath, 'utf8');
|
expect(fsReadFile).toHaveBeenCalledWith(wrapperPath, 'utf8');
|
||||||
expect(fsWriteFile).toHaveBeenCalledWith(`file${path.sep}terraform`, expect.any(String));
|
expect(fsWriteFile).toHaveBeenCalledWith(`file${path.sep}terraform`, expect.any(String), { mode: 0o755 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue