Skip to content

Commit 89bdafd

Browse files
committed
use joinPath
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
1 parent 120056d commit 89bdafd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/mason/MasonPublish.chpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,11 @@ private proc addPackageToBricks(projectLocal: string, safeDir: string,
459459
isLocal: bool) throws {
460460
const bricksDir = joinPath(safeDir, 'Bricks');
461461
const projectBrickDir = joinPath(bricksDir, name);
462-
const versionToml = joinPath(projectBrickDir, versionNum + ".toml");
463462
try! {
464-
const toParse = open(projectLocal + "/Mason.toml", ioMode.r);
463+
const toParse = open(joinPath(projectLocal, "Mason.toml"), ioMode.r);
465464
var tomlFile = (parseToml(toParse));
466465
const versionNum = tomlFile!['brick']!['version']!.s;
466+
const versionToml = joinPath(projectBrickDir, versionNum + ".toml");
467467
if !isLocal {
468468
if !exists(bricksDir) {
469469
throw new MasonError('Registry does not have the expected structure. ' +
@@ -487,8 +487,7 @@ private proc addPackageToBricks(projectLocal: string, safeDir: string,
487487
'already exists in the Bricks.');
488488
exit(1);
489489
}
490-
}
491-
else {
490+
} else {
492491
if !exists(joinPath(safeDir, '.git')) {
493492
throw new MasonError(
494493
'Unable to publish your package to the registry, ' +
@@ -510,7 +509,6 @@ private proc addPackageToBricks(projectLocal: string, safeDir: string,
510509
else {
511510
throw new MasonError('A package with that name and version '+
512511
'already exists in the Bricks.');
513-
exit(1);
514512
}
515513
}
516514
}

0 commit comments

Comments
 (0)