@@ -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