Skip to content

Commit db6742e

Browse files
committed
Exit code and slash instead of backslash
1 parent 698af05 commit db6742e

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

localBuildRun.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ cp -r runners build
66
npm test
77
if [ $? -eq 1 ]; then
88
echo 'tests failed'
9+
exit 1
910
fi
1011
node build/engine/run.js

localBuildTest.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ tsc
22
npm test
33
if [ $? -eq 1 ]; then
44
echo 'tests failed'
5+
exit 1
56
fi

runners/katacoda/dirUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export class DirUtils{
1919

2020
//saves the remaining path, if currentdir is the prefix of targetDir
2121
if(targetDir.substring(0,currentDir.length) == currentDir){
22-
return path.join(targetDir.replace(currentDir + path.sep, ''));
22+
return path.join(targetDir.replace(currentDir + path.sep, '')).replace("\\", "/");
2323
}
2424

2525

2626
else{
2727
//returns the absolut directory, if the first parent folder is different
2828
if(currentPaths[1] != targetPaths[1]){
29-
return targetDir;
29+
return targetDir.replace("\\", "/");
3030
}
3131

3232
//iterates throught currentPath array to compare parent directories
@@ -42,7 +42,7 @@ export class DirUtils{
4242
//slice targetPaths to get the relative path
4343
targetPaths = targetPaths.slice(index + 1, targetPaths.length);
4444

45-
return path.join(dirPath, targetPaths.join(path.sep));
45+
return path.join(dirPath, targetPaths.join(path.sep)).replace("\\", "/");
4646

4747
}
4848

spec/runners/katacoda/dirUtilsSpec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ describe("DirUtils", () => {
99
expect(target.getCdParam(path.join('/root'), path.join('/root'))).toBe('');
1010
});
1111
it("changes directly to the child folder, because currentDir is the prefix of dir", () => {
12-
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/devonfw/setup'))).toBe(path.join('setup'));
12+
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/devonfw/setup'))).toBe(path.join('setup').replace("\\", "/"));
1313
});
1414
it("returns an absolute path, because both dirs don't have matching parent folders", () => {
15-
expect(target.getCdParam(path.join('/setup'), path.join('/root/devonfw/setup'))).toBe(path.join('/root/devonfw/setup'));
15+
expect(target.getCdParam(path.join('/setup'), path.join('/root/devonfw/setup'))).toBe(path.join('/root/devonfw/setup').replace("\\", "/"));
1616
});
1717
it("changes to parent folder before changing to child folder", () => {
18-
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/setup/folder0/folder1'))).toBe(path.join('../setup/folder0/folder1'));
18+
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/setup/folder0/folder1'))).toBe(path.join('../setup/folder0/folder1').replace("\\", "/"));
1919
});
2020
it("changes to parent folder before changing to child folder and one child folder has the same position and name", () => {
21-
expect(target.getCdParam(path.join('/root/devonfw/folder/setup'), path.join('/root/devonfw/setup/setup'))).toBe(path.join('../../setup/setup'));
21+
expect(target.getCdParam(path.join('/root/devonfw/folder/setup'), path.join('/root/devonfw/setup/setup'))).toBe(path.join('../../setup/setup').replace("\\", "/"));
2222
});
2323

2424
});

0 commit comments

Comments
 (0)