Skip to content

Commit b1c3bf6

Browse files
committed
Rename getVirtualEnvironmentName() to getOSNameVersion() for clarity
1 parent d37167a commit b1c3bf6

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

Diff for: common.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ export function selfHostedRunnerReason() {
192192
}
193193
}
194194

195-
let virtualEnvironmentName = undefined
195+
let osNameVersion = undefined
196196

197-
export function getVirtualEnvironmentName() {
198-
if (virtualEnvironmentName !== undefined) {
199-
return virtualEnvironmentName
197+
export function getOSNameVersion() {
198+
if (osNameVersion !== undefined) {
199+
return osNameVersion
200200
}
201201

202202
const platform = os.platform()
@@ -216,12 +216,12 @@ export function getVirtualEnvironmentName() {
216216
throw new Error(`Unknown platform ${platform}`)
217217
}
218218

219-
virtualEnvironmentName = `${osName}-${osVersion}`
220-
return virtualEnvironmentName
219+
osNameVersion = `${osName}-${osVersion}`
220+
return osNameVersion
221221
}
222222

223223
export function getOSNameVersionArch() {
224-
return `${getVirtualEnvironmentName()}-${os.arch()}`
224+
return `${getOSNameVersion()}-${os.arch()}`
225225
}
226226

227227
function findWindowsVersion() {
@@ -258,7 +258,7 @@ export function getRunnerToolCache() {
258258

259259
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
260260
function getDefaultToolCachePath() {
261-
const platform = getVirtualEnvironmentName()
261+
const platform = getOSNameVersion()
262262
if (platform.startsWith('ubuntu-')) {
263263
return '/opt/hostedtoolcache'
264264
} else if (platform.startsWith('macos-')) {

Diff for: dist/index.js

+13-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {getOSNameVersion} from "./common";
2+
13
const os = require('os')
24
const fs = require('fs')
35
const path = require('path')
@@ -44,7 +46,7 @@ export async function setupRuby(options = {}) {
4446

4547
process.chdir(inputs['working-directory'])
4648

47-
const platform = common.getVirtualEnvironmentName()
49+
const platform = common.getOSNameVersion()
4850
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
4951

5052
let installer

0 commit comments

Comments
 (0)