Skip to content

Commit de592a4

Browse files
committed
initial commit
1 parent 8707f5c commit de592a4

3 files changed

Lines changed: 53 additions & 1 deletion

File tree

runners/wikiConsole/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,30 @@ export class WikiConsole extends WikiRunner {
173173

174174
return null;
175175
}
176+
177+
runExecuteCommand(runCommand: RunCommand): RunResult{
178+
let windowsCommand = runCommand.command.parameters[0];
179+
let linuxCommand = runCommand.command.parameters[1];
180+
let dir = (runCommand.command.parameters.length > 2 && runCommand.command.parameters[2].dir)
181+
? runCommand.command.parameters[2].dir
182+
: undefined;
183+
let async = (runCommand.command.parameters.length > 2 && runCommand.command.parameters[2].async)
184+
? runCommand.command.parameters[2].async
185+
: false;
186+
let args = (runCommand.command.parameters.length > 2 && runCommand.command.parameters[2].args)
187+
? runCommand.command.parameters[2].args.join(" ")
188+
: undefined;
189+
let port = (runCommand.command.parameters.length > 3 && runCommand.command.parameters[3].port)
190+
? runCommand.command.parameters[3].port
191+
: undefined;
192+
let appPath = (runCommand.command.parameters.length > 3 && runCommand.command.parameters[3].path)
193+
? runCommand.command.parameters[3].path
194+
: undefined;
195+
196+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "executeCommand.asciidoc"),
197+
{windowsCommand: windowsCommand, linuxCommand: linuxCommand, dir: dir, async: async, args: args, port: port, appPath: appPath });
198+
199+
return null;
200+
}
176201
}
177202

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
== Execute a command
2+
3+
=== Execute a command in a command prompt
4+
First, you need to open a command prompt in your current Workspace. For Windows, you can use Powershell and on Linux, you can use the Terminal.
5+
<% if(async){ %> We want to start a Server so that you have to open a new command prompt, that will be blocked while the server is running. <% } %>
6+
7+
<% if(dir){ %>
8+
The command will be executed in the folder *<%= dir; %>* relative to your current Workspace. If the folders are not present, you maybe missed a wiki chapter and have to create it.
9+
First change your directory with this command `cd <%= dir; %>` <% } %>
10+
11+
.Operating system
12+
. Windows +
13+
Then execute the command `<%- windowsCommand; %><% if(args){ %> <%- args; %><%}%>`.
14+
. Linux and macOS +
15+
Then execute the command `<%- linuxCommand; %><% if(args){ %> <%- args; %><%}%>`.
16+
17+
<% if(port){ %>
18+
19+
=== Startup Assertion
20+
21+
You can check if the server is running correctly by checking if `localhost:<%= port; %>/<%= appPath; %>` is accessible by either using a tool like `curl`, `Postman` or simply accessing the service via your webbrowser.
22+
23+
Example: `curl -Is localhost:<%= port; %>/<%= appPath; %> | head -n 1`
24+
25+
This command should return an `200 OK` header if the service is available.
26+
27+
<% } %>

runners/wikiConsole/templates/runServerJava.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This command will start the Java server.
1818

1919
You can check if the server is running correctly by checking if `localhost:<%= port; %>/<%= app_path; %>` is accessible by either using a tool like `curl`, `Postman` or simply accessing the service via your webbrowser.
2020

21-
Example: `curl -Is localhost:<%= port; %>/<%app_path%> | head -n 1`
21+
Example: `curl -Is localhost:<%= port; %>/<%= app_path; %> | head -n 1`
2222

2323
This command should return an `200 OK` header if the service is available.
2424

0 commit comments

Comments
 (0)