From 467a9812256033cbdb1dcc41a0be7f40e60cf445 Mon Sep 17 00:00:00 2001 From: Leon Wright Date: Fri, 22 Jul 2022 16:02:07 +0800 Subject: [PATCH] feat: Add 'IS_MAC' util --- dist/setup/index.js | 3 ++- src/setup-python.ts | 3 ++- src/utils.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 8477836..739b53f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -65430,6 +65430,7 @@ const semver = __importStar(__nccwpck_require__(1383)); const exec = __importStar(__nccwpck_require__(1514)); exports.IS_WINDOWS = process.platform === 'win32'; exports.IS_LINUX = process.platform === 'linux'; +exports.IS_MAC = process.platform === 'darwin'; exports.WINDOWS_ARCHS = ['x86', 'x64']; exports.WINDOWS_PLATFORMS = ['win32', 'win64']; const PYPY_VERSION_FILE = 'PYPY_VERSION'; @@ -65761,4 +65762,4 @@ module.exports = JSON.parse('["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac", /******/ module.exports = __webpack_exports__; /******/ /******/ })() -; \ No newline at end of file +; diff --git a/src/setup-python.ts b/src/setup-python.ts index 0be5acf..bfecd07 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -7,7 +7,8 @@ import fs from 'fs'; import {getCacheDistributor} from './cache-distributions/cache-factory'; import { isCacheFeatureAvailable, - logWarning + logWarning, + IS_MAC } from './utils'; function isPyPyVersion(versionSpec: string) { diff --git a/src/utils.ts b/src/utils.ts index 7d4fa02..b29c79d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -7,6 +7,7 @@ import * as exec from '@actions/exec'; export const IS_WINDOWS = process.platform === 'win32'; export const IS_LINUX = process.platform === 'linux'; +export const IS_MAC = process.platform === 'darwin'; export const WINDOWS_ARCHS = ['x86', 'x64']; export const WINDOWS_PLATFORMS = ['win32', 'win64']; const PYPY_VERSION_FILE = 'PYPY_VERSION';