mirror of
https://github.com/actions/setup-go.git
synced 2025-04-24 01:50:52 +00:00
fix whitespace reformat and missing ;
This commit is contained in:
parent
fc952ad45a
commit
c401b8cb9d
2 changed files with 64 additions and 65 deletions
|
@ -263,7 +263,7 @@ describe('setup-go', () => {
|
||||||
const toolPath = path.normalize('/cache/go/1.13.0/x64');
|
const toolPath = path.normalize('/cache/go/1.13.0/x64');
|
||||||
findSpy.mockImplementation(() => toolPath);
|
findSpy.mockImplementation(() => toolPath);
|
||||||
|
|
||||||
const vars: { [key: string]: string } = {};
|
const vars: {[key: string]: string} = {};
|
||||||
exportVarSpy.mockImplementation((name: string, val: string) => {
|
exportVarSpy.mockImplementation((name: string, val: string) => {
|
||||||
vars[name] = val;
|
vars[name] = val;
|
||||||
});
|
});
|
||||||
|
@ -279,7 +279,7 @@ describe('setup-go', () => {
|
||||||
const toolPath = path.normalize('/cache/go/1.8.0/x64');
|
const toolPath = path.normalize('/cache/go/1.8.0/x64');
|
||||||
findSpy.mockImplementation(() => toolPath);
|
findSpy.mockImplementation(() => toolPath);
|
||||||
|
|
||||||
const vars: { [key: string]: string } = {};
|
const vars: {[key: string]: string} = {};
|
||||||
exportVarSpy.mockImplementation((name: string, val: string) => {
|
exportVarSpy.mockImplementation((name: string, val: string) => {
|
||||||
vars[name] = val;
|
vars[name] = val;
|
||||||
});
|
});
|
||||||
|
@ -523,8 +523,7 @@ describe('setup-go', () => {
|
||||||
return '/Users/testuser/go';
|
return '/Users/testuser/go';
|
||||||
});
|
});
|
||||||
|
|
||||||
mkdirpSpy.mockImplementation(async () => {
|
mkdirpSpy.mockImplementation(async () => {});
|
||||||
});
|
|
||||||
existsSpy.mockImplementation(() => {
|
existsSpy.mockImplementation(() => {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -967,9 +966,9 @@ ruby 3.2.1
|
||||||
`;
|
`;
|
||||||
|
|
||||||
it('reads version from .tool-versions when specified', async () => {
|
it('reads version from .tool-versions when specified', async () => {
|
||||||
inputs['tool-versions-file'] = '.special-tool-versions'
|
inputs['tool-versions-file'] = '.special-tool-versions';
|
||||||
existsSpy.mockImplementation(() => true);
|
existsSpy.mockImplementation(() => true);
|
||||||
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile))
|
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile));
|
||||||
|
|
||||||
await main.run();
|
await main.run();
|
||||||
|
|
||||||
|
@ -979,10 +978,10 @@ ruby 3.2.1
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is overwritten by go-version param', async () => {
|
it('is overwritten by go-version param', async () => {
|
||||||
inputs['go-version'] = '1.18.2'
|
inputs['go-version'] = '1.18.2';
|
||||||
inputs['tool-versions-file'] = '.special-tool-versions'
|
inputs['tool-versions-file'] = '.special-tool-versions';
|
||||||
existsSpy.mockImplementation(() => true);
|
existsSpy.mockImplementation(() => true);
|
||||||
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile))
|
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile));
|
||||||
|
|
||||||
await main.run();
|
await main.run();
|
||||||
|
|
||||||
|
@ -993,7 +992,7 @@ ruby 3.2.1
|
||||||
|
|
||||||
it('uses .tool-versions as a default when no version specified', async () => {
|
it('uses .tool-versions as a default when no version specified', async () => {
|
||||||
existsSpy.mockImplementation(() => true);
|
existsSpy.mockImplementation(() => true);
|
||||||
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile))
|
readFileSpy.mockImplementation(() => Buffer.from(toolVersionsFile));
|
||||||
|
|
||||||
await main.run();
|
await main.run();
|
||||||
|
|
||||||
|
|
|
@ -160,19 +160,19 @@ function resolveVersionInput(): string {
|
||||||
if(toolVersionsPath && !fs.existsSync(toolVersionsPath)) {
|
if(toolVersionsPath && !fs.existsSync(toolVersionsPath)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The specified .tool-versions file at ${toolVersionsPath} does not exist`
|
`The specified .tool-versions file at ${toolVersionsPath} does not exist`
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toolVersionsPath) {
|
if (!toolVersionsPath) {
|
||||||
toolVersionsPath = '.tool-versions'
|
toolVersionsPath = '.tool-versions';
|
||||||
if(!fs.existsSync(toolVersionsPath)) {
|
if(!fs.existsSync(toolVersionsPath)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`No .tool-versions file was found in the project path. Please specify using tool-versions-file`
|
`No .tool-versions file was found in the project path. Please specify using tool-versions-file`
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version = installer.parseToolVersionsFile(toolVersionsPath)
|
version = installer.parseToolVersionsFile(toolVersionsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
|
|
Loading…
Add table
Reference in a new issue