Update readme and correctly add path

This commit is contained in:
Thomas Boop
2020-11-16 11:13:21 -05:00
parent 4861e20f66
commit 4cd1e346a4
4 changed files with 27 additions and 8 deletions

View File

@@ -187,12 +187,17 @@ async function choco(tool: Tool, version: string): Promise<void> {
}
);
// Manually add the path because it won't happen until the end of the step normally
const pathArray = version.split('.');
const pathVersion =
pathArray.length > 3
? pathArray.slice(0, pathArray.length - 1).join('.')
: pathArray.join('.');
const chocoPath = join(
`${process.env.ChocolateyInstall}`,
'lib',
`${tool}.${version}`,
'tools',
`${tool}-${version}`,
tool === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here
tool === 'ghc' ? 'bin' : ''
);
core.addPath(chocoPath);