committed by
Fabio Niephaus
parent
1a4a7ccb68
commit
2240cb3432
@@ -2,6 +2,7 @@ import {GRAALVM_PLATFORM} from './constants'
|
||||
import {exec} from '@actions/exec'
|
||||
import {join} from 'path'
|
||||
|
||||
const BASE_FLAGS = ['--non-interactive', 'install', '--no-progress']
|
||||
const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
|
||||
[
|
||||
'linux',
|
||||
@@ -21,10 +22,16 @@ const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
|
||||
])
|
||||
|
||||
export async function setUpGUComponents(
|
||||
gdsToken: string,
|
||||
graalVMHome: string,
|
||||
components: string[]
|
||||
): Promise<void> {
|
||||
await exec('gu', ['install', '--no-progress'].concat(components))
|
||||
const optionalFlags = []
|
||||
if (gdsToken.length > 0) {
|
||||
optionalFlags.push('--token', gdsToken)
|
||||
}
|
||||
|
||||
await exec('gu', BASE_FLAGS.concat(optionalFlags, components))
|
||||
|
||||
const platformHooks = COMPONENT_TO_POST_INSTALL_HOOK.get(GRAALVM_PLATFORM)
|
||||
if (platformHooks) {
|
||||
|
||||
Reference in New Issue
Block a user