Skip to content

Commit d29cef8

Browse files
authored
[VIDEO-2647] - Correct windows drive context (#168)
* [VIDEO-2647] - Adjusted windows drive pathing based on runner context * [VIDEO-2647] - Forgot to run npm prepare before pushing
1 parent e1d0aef commit d29cef8

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

dist/index.js

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

dist/index.js.map

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

index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const github = require('@actions/github');
66
const tc = require('@actions/tool-cache');
77
const io = require('@actions/io');
88
const semver = require('semver');
9-
const { parseEtcRelease, isSelfHosted } = require('./utils');
9+
const { parseEtcRelease, isSelfHosted, getWindowsDrive } = require('./utils');
1010

1111
function LinuxDistroConfig(versionIds, envMap, commands) {
1212
return {
@@ -79,12 +79,11 @@ async function run() {
7979
if (arch != 'x86' && arch != 'x86_64') {
8080
core.setFailed('"arch" may only be x86 or x86_64');
8181
}
82-
82+
const rootDriveLetter = isSelfHosted() ? 'C:' : getWindowsDrive(process.cwd()) + ':';
8383
if (buildSource) {
8484
const installDir =
85-
process.env.GSTREAMER_INSTALL_DIR ?? path.join(isSelfHosted() ? 'C:' : 'D:', `gstreamer\\1.0\\msvc_${arch}`);
86-
87-
const sourceDir = path.join(isSelfHosted() ? 'C:' : 'D:', 'gstreamer_source');
85+
process.env.GSTREAMER_INSTALL_DIR ?? path.join(rootDriveLetter, `gstreamer\\1.0\\msvc_${arch}`);
86+
const sourceDir = path.join(rootDriveLetter, 'gstreamer_source');
8887

8988
core.info("Cloning gstreamer's git repository...");
9089
await exec.exec('git', ['config', '--global', 'http.postBuffer', '524288000']);
@@ -126,7 +125,7 @@ async function run() {
126125
gstreamerPath = installDir;
127126
} else {
128127
const installDir =
129-
process.env.GSTREAMER_INSTALL_DIR ?? path.join(isSelfHosted() ? 'C:' : 'D:', 'gstreamer');
128+
process.env.GSTREAMER_INSTALL_DIR ?? path.join(rootDriveLetter, 'gstreamer');
130129

131130
const installers = [
132131
`gstreamer-1.0-msvc-${arch}-${version}.msi`,

utils.js

+5
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ exports.isSelfHosted = () =>
3535
process.env['AGENT_ISSELFHOSTED'] === '1' ||
3636
(process.env['AGENT_ISSELFHOSTED'] === undefined &&
3737
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted');
38+
39+
exports.getWindowsDrive = (path) => {
40+
const drive = path.split(':')[0];
41+
return drive;
42+
}

0 commit comments

Comments
 (0)