Skip to content

Commit 3bcaacb

Browse files
implemented command createProject in console runner
1 parent 9b17e13 commit 3bcaacb

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

runners/console/index.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ export class Console extends Runner {
6464
let result = new RunResult();
6565
result.returnCode = 0;
6666

67+
let workspaceDir = path.join(this.getWorkingDirectory(), "devonfw", "workspaces", "main")
68+
if(this.platform == ConsolePlatform.WINDOWS) {
69+
this.executeCommandSync("devon " + command.parameters[0] + " create com.example.application." + command.parameters[1], workspaceDir, result);
70+
} else {
71+
this.executeCommandSync("~/.devon/devon " + command.parameters[0] + " create com.example.application." + command.parameters[1], path.join(this.getWorkingDirectory(), "devonfw"), result);
72+
}
73+
6774
return result;
6875
}
6976

@@ -100,7 +107,19 @@ export class Console extends Runner {
100107
}
101108

102109
async assertCreateProject(step: Step, command: Command, result: RunResult) {
103-
console.log("assertCreateProject");
110+
let workspaceDir = path.join(this.getWorkingDirectory(), "devonfw", "workspaces", "main");
111+
112+
let assert = new Assertions()
113+
.noErrorCode(result)
114+
.noException(result)
115+
.directoryExits(path.join(workspaceDir, command.parameters[1]));
116+
117+
if(command.parameters[0] == "java") {
118+
assert.directoryExits(path.join(workspaceDir, command.parameters[1], "api", "src", "main", "java"))
119+
.directoryExits(path.join(workspaceDir, command.parameters[1], "core", "src", "main", "java"))
120+
.directoryExits(path.join(workspaceDir, command.parameters[1], "server", "src", "main", "java"))
121+
.fileExits(path.join(workspaceDir, command.parameters[1], "core", "src", "main", "java", "com", "example", "application", command.parameters[1], "SpringBootApp.java"));
122+
}
104123
}
105124

106125
private executeCommandSync(command: string, directory: string, result: RunResult, input?: string) {

0 commit comments

Comments
 (0)