Skip to content

Commit

Permalink
Working CLI tool package generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Aug 21, 2023
1 parent 1adfdb4 commit 16e7984
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli-tool/project_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class ProjectGenerator {

getTarget();
while(target != '' &&
targetArchs)
targetArchs.indexOf(target) == -1)
getTarget();

if(target)
Expand Down Expand Up @@ -233,5 +233,7 @@ export class ProjectGenerator {
ProjectGenerator.getOutputFolder(projectStruct);
ProjectGenerator.getTarget(projectStruct);
})();

CLIToolUtil.saveStructureToFile(projectStruct);
}
}
10 changes: 10 additions & 0 deletions cli-tool/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import ProjectStructure from './project_structure';

export class CLIToolUtil {
public static prompt(message: string): string {
Expand Down Expand Up @@ -32,4 +33,13 @@ export class CLIToolUtil {
return /^[^\\/?%*:|"<>\.]+$/
.test(folderName);
}

public static saveStructureToFile(
projectStruct: ProjectStructure
): void {
fs.writeFileSync(
'yttria-config.json',
JSON.stringify(projectStruct, null, 4)
);
}
}

0 comments on commit 16e7984

Please sign in to comment.