Skip to content

Commit

Permalink
[ISSUE 153] error on joining folder on windows (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ginxo authored Jun 15, 2021
1 parent 06d5783 commit ceebe59
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

# V2.5 (next release)
# V2.5

## Enhancements:

Expand All @@ -10,6 +10,9 @@
- allow to read definition files from private repositories
- pre/post sections

## Bugs:
- windows error on joining folder https://github.com/kiegroup/github-action-build-chain/issues/153

# V2.4

## Enhancements:
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8201,6 +8201,7 @@ const { checkUrlExist } = __webpack_require__(22);
const { getNodeTriggeringJob } = __webpack_require__(645);
const { copyNodeFolder } = __webpack_require__(828);
const fs = __webpack_require__(747);
const path = __webpack_require__(622);

async function checkoutDefinitionTree(
context,
Expand Down Expand Up @@ -8616,8 +8617,7 @@ function getDir(rootFolder, project, skipCheckoutProjectFolder = undefined) {
}
const folder =
rootFolder !== undefined && rootFolder !== "" ? rootFolder : ".";

return `${folder}/${project.replace(/ |-/g, "_").replace("/", "_")}`;
return `${path.join(folder, project.replace(/ |-/g, "_").replace("/", "_"))}`;
}

async function getForkedProjectName(octokit, owner, project, wantedOwner) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kie/build-chain-action",
"version": "2.2.24",
"version": "2.2.25",
"description": "GitHub action to define action chains",
"main": "dist/build-chain-cli.js",
"author": "Enrique Mingorance Cano <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/flows/common/build-chain-flow-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { checkUrlExist } = require("../../util/http");
const { getNodeTriggeringJob } = require("../../util/chain-util");
const { copyNodeFolder } = require("../../util/fs-util");
const fs = require("fs");
const path = require("path");

async function checkoutDefinitionTree(
context,
Expand Down Expand Up @@ -426,8 +427,7 @@ function getDir(rootFolder, project, skipCheckoutProjectFolder = undefined) {
}
const folder =
rootFolder !== undefined && rootFolder !== "" ? rootFolder : ".";

return `${folder}/${project.replace(/ |-/g, "_").replace("/", "_")}`;
return `${path.join(folder, project.replace(/ |-/g, "_").replace("/", "_"))}`;
}

async function getForkedProjectName(octokit, owner, project, wantedOwner) {
Expand Down
8 changes: 4 additions & 4 deletions test/lib/flows/common/build-chain-flow-helper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,25 +696,25 @@ test("checkoutDefinitionTree sBranch does not exists but has PR no root Folder",
// Assert
expect(mergeMock).toHaveBeenCalledTimes(2);
expect(mergeMock).toHaveBeenCalledWith(
"./kiegroup_lienzo_core",
"kiegroup_lienzo_core",
"URL_with_token/sourceGroup/lienzo-core-forked",
"sBranch"
);
expect(mergeMock).toHaveBeenCalledWith(
"./kiegroup_droolsjbpm_build_bootstrap",
"kiegroup_droolsjbpm_build_bootstrap",
"URL_with_token/kiegroup/droolsjbpm-build-bootstrap",
"sBranch"
);

expect(cloneMock).toHaveBeenCalledTimes(2);
expect(cloneMock).toHaveBeenCalledWith(
"URL_with_token/kiegroup/lienzo-core",
"./kiegroup_lienzo_core",
"kiegroup_lienzo_core",
"tBranch"
);
expect(cloneMock).toHaveBeenCalledWith(
"URL_with_token/kiegroup/droolsjbpm-build-bootstrap",
"./kiegroup_droolsjbpm_build_bootstrap",
"kiegroup_droolsjbpm_build_bootstrap",
"tBranch"
);

Expand Down

0 comments on commit ceebe59

Please sign in to comment.