From a803c8eafac593a76013e831fdfa31c47b8651e9 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 30 Sep 2019 11:20:46 -0700 Subject: [PATCH] These do not need to be async --- src/installer.ts | 22 +++++++++------------- src/setup-haskell.ts | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index f59011e..aa18ee5 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -2,21 +2,18 @@ import * as core from '@actions/core'; import * as fs from 'fs'; import * as path from 'path'; -export async function findHaskellGHCVersion( - baseInstallDir: string, - version: string -) { +export function findHaskellGHCVersion(baseInstallDir: string, version: string) { return _findHaskellToolVersion(baseInstallDir, 'ghc', version); } -export async function findHaskellCabalVersion( +export function findHaskellCabalVersion( baseInstallDir: string, version: string ) { return _findHaskellToolVersion(baseInstallDir, 'cabal', version); } -export async function _findHaskellToolVersion( +export function _findHaskellToolVersion( baseInstallDir: string, tool: string, version: string @@ -33,11 +30,10 @@ export async function _findHaskellToolVersion( const toolPath: string = path.join(baseInstallDir, tool, version, 'bin'); throw new Error(`Looking in ${toolPath}`); - - if (fs.existsSync(toolPath)) { - core.debug(`Found tool in cache ${tool} ${version}`); - core.addPath(toolPath); - } else { - throw new Error(`Version ${version} of ${tool} not found`); - } + // if (fs.existsSync(toolPath)) { + // core.debug(`Found tool in cache ${tool} ${version}`); + // core.addPath(toolPath); + // } else { + // throw new Error(`Version ${version} of ${tool} not found`); + // } } diff --git a/src/setup-haskell.ts b/src/setup-haskell.ts index 6230af6..d978965 100644 --- a/src/setup-haskell.ts +++ b/src/setup-haskell.ts @@ -13,13 +13,13 @@ async function run() { if (!ghcVersion) { ghcVersion = defaultGHCVersion; } - await findHaskellGHCVersion(baseInstallDir, ghcVersion); + findHaskellGHCVersion(baseInstallDir, ghcVersion); let cabalVersion = core.getInput('cabal-version'); if (!cabalVersion) { cabalVersion = defaultCabalVersion; } - await findHaskellCabalVersion(baseInstallDir, cabalVersion); + findHaskellCabalVersion(baseInstallDir, cabalVersion); } catch (error) { core.setFailed(error.message); }