From 3c644cf2fc58cad856c3ba5ed8f6775ac79fa2a9 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 5 Jan 2020 19:46:53 +0100 Subject: [PATCH] Better error if MSYS2 is missing --- dist/index.js | 3 +++ windows.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index db8a934..ac92e56 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6494,6 +6494,9 @@ async function downloadExtractAndSetPATH(ruby) { async function linkMSYS2() { const toolCacheVersions = tc.findAllVersions('Ruby') toolCacheVersions.sort() + if (toolCacheVersions.length == 0) { + throw new Error('Could not find MSYS2 in the toolcache') + } const latestVersion = toolCacheVersions.slice(-1)[0] const latestHostedRuby = tc.find('Ruby', latestVersion) diff --git a/windows.js b/windows.js index 202d100..bffa788 100644 --- a/windows.js +++ b/windows.js @@ -32,6 +32,9 @@ export async function downloadExtractAndSetPATH(ruby) { async function linkMSYS2() { const toolCacheVersions = tc.findAllVersions('Ruby') toolCacheVersions.sort() + if (toolCacheVersions.length == 0) { + throw new Error('Could not find MSYS2 in the toolcache') + } const latestVersion = toolCacheVersions.slice(-1)[0] const latestHostedRuby = tc.find('Ruby', latestVersion)