From 8c436244fceb0e4696f2355a5a892941d4c6a2fe Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Mon, 6 Mar 2023 22:15:59 +0000 Subject: [PATCH] [Dev] enable `opensearch snapshot` for Darwin Enable the downloading of Darwin for running the command `yarn opensearch snapshot`. Darwin is not officially supported but snapshots are being built here: https://build.ci.opensearch.org/job/distribution-build-opensearch/ Issue resolved: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2944 Signed-off-by: Kawika Avilla --- packages/osd-opensearch/src/artifact.js | 4 ++-- packages/osd-opensearch/src/artifact.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/osd-opensearch/src/artifact.js b/packages/osd-opensearch/src/artifact.js index b7d8857ba09f..cd1702213d4d 100644 --- a/packages/osd-opensearch/src/artifact.js +++ b/packages/osd-opensearch/src/artifact.js @@ -188,8 +188,8 @@ async function getArtifactSpecForSnapshotFromUrl(urlVersion, log) { const arch = process.arch === 'arm64' ? 'arm64' : 'x64'; const extension = process.platform === 'win32' ? 'zip' : 'tar.gz'; - if (platform !== 'linux' && platform !== 'windows') { - throw createCliError(`Snapshots are only available for Linux and Windows`); + if (platform !== 'linux' && platform !== 'windows' && platform !== 'darwin') { + throw createCliError(`Snapshots are only available for Linux, Windows, and Darwin`); } const latestUrl = `${DAILY_SNAPSHOTS_BASE_URL}/${desiredVersion}-SNAPSHOT`; diff --git a/packages/osd-opensearch/src/artifact.test.js b/packages/osd-opensearch/src/artifact.test.js index 1d5d0bdf330c..92f3700c7935 100644 --- a/packages/osd-opensearch/src/artifact.test.js +++ b/packages/osd-opensearch/src/artifact.test.js @@ -163,10 +163,10 @@ describe('Artifact', () => { }); }); - it('should throw when on a non-Linux or non-Windows platform', async () => { + it('should throw when on a non-Linux, non-Windows, non-Darwin platform', async () => { Object.defineProperties(process, { platform: { - value: 'darwin', + value: 'android', }, arch: { value: ORIGINAL_ARCHITECTURE,