mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-25 10:49:55 +00:00
feat: Add tool-cache checking function
This commit is contained in:
parent
0aeab8d284
commit
545262d3b9
1 changed files with 19 additions and 0 deletions
|
@ -111,3 +111,22 @@ export async function install_nextflow(
|
||||||
|
|
||||||
return temp_install_dir
|
return temp_install_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function check_cache(version: string): boolean {
|
||||||
|
const cleaned_version = semver.clean(version, true)
|
||||||
|
if (cleaned_version === null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const resolved_version = String(cleaned_version)
|
||||||
|
|
||||||
|
const nf_path = tc.find("nextflow", resolved_version)
|
||||||
|
if (!nf_path) {
|
||||||
|
core.debug(`Could not find Nextflow ${resolved_version} in the tool cache`)
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
core.debug(`Found Nextflow ${resolved_version} at path '${nf_path}'`)
|
||||||
|
core.debug(`Adding '${nf_path}' to PATH`)
|
||||||
|
core.addPath(nf_path)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue