Skip to content

Commit

Permalink
[VIDEO-2647] - Correct windows drive context (#168)
Browse files Browse the repository at this point in the history
* [VIDEO-2647] - Adjusted windows drive pathing based on runner context

* [VIDEO-2647] - Forgot to run npm prepare before pushing
  • Loading branch information
lyramcmillan authored Jan 26, 2024
1 parent e1d0aef commit d29cef8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
16 changes: 10 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const github = require('@actions/github');
const tc = require('@actions/tool-cache');
const io = require('@actions/io');
const semver = require('semver');
const { parseEtcRelease, isSelfHosted } = require('./utils');
const { parseEtcRelease, isSelfHosted, getWindowsDrive } = require('./utils');

function LinuxDistroConfig(versionIds, envMap, commands) {
return {
Expand Down Expand Up @@ -79,12 +79,11 @@ async function run() {
if (arch != 'x86' && arch != 'x86_64') {
core.setFailed('"arch" may only be x86 or x86_64');
}

const rootDriveLetter = isSelfHosted() ? 'C:' : getWindowsDrive(process.cwd()) + ':';
if (buildSource) {
const installDir =
process.env.GSTREAMER_INSTALL_DIR ?? path.join(isSelfHosted() ? 'C:' : 'D:', `gstreamer\\1.0\\msvc_${arch}`);

const sourceDir = path.join(isSelfHosted() ? 'C:' : 'D:', 'gstreamer_source');
process.env.GSTREAMER_INSTALL_DIR ?? path.join(rootDriveLetter, `gstreamer\\1.0\\msvc_${arch}`);
const sourceDir = path.join(rootDriveLetter, 'gstreamer_source');

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

const installers = [
`gstreamer-1.0-msvc-${arch}-${version}.msi`,
Expand Down
5 changes: 5 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ exports.isSelfHosted = () =>
process.env['AGENT_ISSELFHOSTED'] === '1' ||
(process.env['AGENT_ISSELFHOSTED'] === undefined &&
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted');

exports.getWindowsDrive = (path) => {
const drive = path.split(':')[0];
return drive;
}

0 comments on commit d29cef8

Please sign in to comment.