Skip to content

Commit 8a7465e

Browse files
committed
relative_to: macos: sys: greadlink required
1 parent f0211da commit 8a7465e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

+stdlib/+sys/relative_to.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
if ispc()
1010
cmd = sprintf('pwsh -c "Resolve-Path -Path ''%s'' -RelativeBasePath ''%s'' -Relative"', other, base);
11+
elseif ismac()
12+
cmd = sprintf('grealpath --relative-to="%s" "%s"', base, other);
1113
else
1214
cmd = sprintf('realpath --relative-to="%s" "%s"', base, other);
1315
end

test/is_capable.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function is_capable(tc, f)
66

77
n = func2str(f);
88

9-
if contains(n, "dotnet")
9+
if contains(n, ".dotnet.")
1010

1111
dapi = stdlib.dotnet_api();
1212

@@ -24,7 +24,7 @@ function is_capable(tc, f)
2424
tc.assumeGreaterThanOrEqual(dapi, 6);
2525
end
2626

27-
elseif contains(n, "java")
27+
elseif contains(n, ".java.")
2828

2929
japi = stdlib.java_api();
3030
tc.assumeGreaterThan(japi, 0, "Java not available")
@@ -49,6 +49,12 @@ function is_capable(tc, f)
4949
tc.assumeTrue(isunix() || ~isMATLABReleaseOlderThan('R2024a'))
5050
end
5151

52+
elseif contains(n, ".sys.")
53+
54+
if ismac() && endsWith(n, "relative_to")
55+
tc.assumeNotEmpty(stdlib.which("greadlink"), "brew install coreutils")
56+
end
57+
5258
end
5359

5460
end

0 commit comments

Comments
 (0)