Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix macos names for graalpy
  • Loading branch information
timfel committed Aug 21, 2023
commit b69593376d4c33b67437ce9af6e9b38e6a912b8d
8 changes: 6 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69735,10 +69735,14 @@ function findAsset(item, architecture, platform) {
: architecture === 'arm64'
? 'aarch64'
: architecture;
const graalpyPlatform = platform == 'win32' ? 'windows' : platform;
const graalpyPlatform = platform === 'win32'
? 'windows'
: platform === 'darwin'
? 'macos'
: platform;
if (item.assets) {
return item.assets.find((file) => {
const match_data = file.name.match('.*(darwin|linux|windows)-(amd64|aarch64).tar.gz$');
const match_data = file.name.match('.*(macos|linux|windows)-(amd64|aarch64).tar.gz$');
return (match_data &&
match_data[1] === graalpyPlatform &&
match_data[2] === graalpyArch);
Expand Down
11 changes: 8 additions & 3 deletions src/install-graalpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,16 @@ export function findAsset(
: architecture === 'arm64'
? 'aarch64'
: architecture;
const graalpyPlatform = platform == 'win32' ? 'windows' : platform;
if (item.assets) {
const graalpyPlatform =
platform === 'win32'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change it to IS_WINDOWS from utils.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform here is a parameter to the function. I think it would be weird if it overrode the passed parameter with the current platform.

? 'windows'
: platform === 'darwin'
? 'macos'
: platform;
if (item.assets) {
return item.assets.find((file: IGraalPyManifestAsset) => {
const match_data = file.name.match(
'.*(darwin|linux|windows)-(amd64|aarch64).tar.gz$'
'.*(macos|linux|windows)-(amd64|aarch64).tar.gz$'
);
return (
match_data &&
Expand Down