Skip to content

Commit 211d5d1

Browse files
committed
Update: Use osx-universal distribution for redub osx
1 parent 920c14b commit 211d5d1

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

__tests__/d-redub.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { exeExt, Redub } from '../src/d'
2+
import * as testUtils from './test-helpers.test'
3+
import * as utils from '../src/utils'
4+
5+
testUtils.saveProcessRestorePoint()
6+
testUtils.disableNetwork()
7+
testUtils.hideConsoleLogs()
8+
9+
function init (version: string) { return Redub.initialize(version, '') }
10+
11+
test('Test that redub uses osx-universal for macOS', async () => {
12+
Object.defineProperty(process, 'platform', { value: 'darwin' })
13+
14+
Object.defineProperty(process, 'arch', { value: 'arm64' })
15+
await expect(init('v1.25.2')).resolves.toHaveProperty(
16+
'url', `https://github.com/MrcSnm/redub/releases/download/v1.25.2/redub-v1.25.2-osx-universal${exeExt}`)
17+
18+
Object.defineProperty(process, 'arch', { value: 'x64' })
19+
await expect(init('v1.25.2')).resolves.toHaveProperty(
20+
'url', `https://github.com/MrcSnm/redub/releases/download/v1.25.2/redub-v1.25.2-osx-universal${exeExt}`)
21+
})

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as semver from './semver'
77
import * as exec from '@actions/exec'
88

99
const sep = (process.platform == 'win32' ? '\\' : '/')
10-
const exeExt = (process.platform == 'win32' ? '.exe' : '')
10+
export const exeExt = (process.platform == 'win32' ? '.exe' : '')
1111

1212
export const SETTINGS = {
1313
verify_sig: core.getInput('verify_sig') !== 'false'
@@ -770,6 +770,8 @@ export class Redub implements ITool {
770770
constructor(public url: string, public version: string){}
771771

772772
static getUrlArchSuffix (version: string) {
773+
if(process.platform == "darwin")
774+
return "universal";
773775
switch(process.arch)
774776
{
775777
case "x64": return "x86_64";

0 commit comments

Comments
 (0)