Skip to content

Commit

Permalink
Correct the generated path for downloading plugins by their names on …
Browse files Browse the repository at this point in the history
…Windows (#4953) (#4971)

* Correct the generated path for downloading plugins by their names on Windows

Signed-off-by: Miki <miki@amazon.com>

* Update snapshot for unit test

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Add link for integration to lycheeexlude

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Miki <miki@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 43fe5d5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent e69d38d commit 062ac82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .lycheeexclude
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ http://helpmenow.com/problem2
https://sass-lang.com/*
http://api.jquery.com/*
http://brandonaaron.net
https://www.circl.lu/doc/misp/
5 changes: 3 additions & 2 deletions src/cli_plugin/install/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ function generateUrls({ version, plugin }) {
}

function generatePluginUrl(version, plugin) {
const platform = process.platform === 'win32' ? 'windows' : process.platform;
const [platform, type] =
process.platform === 'win32' ? ['windows', 'zip'] : [process.platform, 'tar'];
const arch = process.arch === 'arm64' ? 'arm64' : 'x64';

return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/tar/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`;
return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/${type}/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`;
}

export function parseMilliseconds(val) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('parse function', function () {
"timeout": 0,
"urls": Array [
"plugin name",
"https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/1234/latest/windows/x64/tar/builds/opensearch-dashboards/plugins/plugin name-1234.zip",
"https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/1234/latest/windows/x64/zip/builds/opensearch-dashboards/plugins/plugin name-1234.zip",
],
"version": 1234,
"workingPath": <absolute path>/plugins/.plugin.installing,
Expand Down

0 comments on commit 062ac82

Please sign in to comment.