Skip to content

Commit

Permalink
Fix #441
Browse files Browse the repository at this point in the history
  • Loading branch information
osyrisrblx committed Jun 24, 2024
1 parent 0c0b2aa commit 43af2f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rojo-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"required": ["name", "tree"],
"required": ["tree"],
"type": "object",
"properties": {
"name": {
Expand Down
6 changes: 4 additions & 2 deletions src/RojoResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface RojoTreeMembers {

interface RojoFile {
servePort?: number;
name: string;
name?: string;
tree: RojoTree;
}

Expand Down Expand Up @@ -219,7 +219,9 @@ export class RojoResolver {
configJson = JSON.parse(fs.readFileSync(realPath).toString());
} finally {
if (isValidRojoConfig(configJson)) {
this.parseTree(path.dirname(rojoConfigFilePath), configJson.name, configJson.tree, doNotPush);
const folderName = path.dirname(rojoConfigFilePath);
const name = configJson.name ?? folderName;
this.parseTree(folderName, name, configJson.tree, doNotPush);
} else {
this.warn(`RojoResolver: Invalid configuration! ${ajv.errorsText(validateRojo.get().errors)}`);
}
Expand Down

0 comments on commit 43af2f7

Please sign in to comment.