Fixing the path to the file

This commit is contained in:
Peter Murray
2022-10-25 17:48:47 +00:00
committed by GitHub
parent a5e48b32cd
commit 438332251b
3 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -401,8 +401,9 @@ function checkForMultiModule(reactorJsonFile) {
// TODO this is assuming the checkout was made into the base path of the workspace...
function getRepositoryRelativePath(file) {
const workspaceDirectory = path.resolve(process.env.GITHUB_WORKSPACE || '.');
const fileResolved = path.dirname(path.resolve(file));
if (fileResolved.startsWith(workspaceDirectory)) {
const fileResolved = path.resolve(file);
const fileDirectory = path.dirname(fileResolved);
if (fileDirectory.startsWith(workspaceDirectory)) {
return fileResolved.substring(workspaceDirectory.length + path.sep.length);
}
else {
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -113,9 +113,10 @@ function checkForMultiModule(reactorJsonFile) {
// TODO this is assuming the checkout was made into the base path of the workspace...
function getRepositoryRelativePath(file) {
const workspaceDirectory = path.resolve(process.env.GITHUB_WORKSPACE || '.');
const fileResolved = path.dirname(path.resolve(file));
const fileResolved = path.resolve(file);
const fileDirectory = path.dirname(fileResolved);
if (fileResolved.startsWith(workspaceDirectory)) {
if (fileDirectory.startsWith(workspaceDirectory)) {
return fileResolved.substring(workspaceDirectory.length + path.sep.length);
} else {
return path.resolve(file);