Skip to content

Commit 33e867e

Browse files
committed
Setup Terminals Manager to auto-start server and tunneling
1 parent 1833d61 commit 33e867e

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"vscjava.vscode-java-debug",
2222
"vscjava.vscode-java-dependency",
2323
"groovy.groovy",
24-
"redhat.vscode-yaml"
24+
"redhat.vscode-yaml",
25+
"fabiospampinato.vscode-terminals"
2526
]
2627
}
2728
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
mkdir -p /workspaces/ShowScript/.vscode
3+
4+
cp /workspaces/ShowScript/sandbox/scripts/terminals.json /workspaces/ShowScript/.vscode/terminals.json

sandbox/scripts/setup-environment.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
22
ln -s /data /workspaces/ShowScript/sandbox
33

4-
54
# Ensure the plugins directory exists
65
mkdir -p /workspaces/ShowScript/sandbox/data/plugins
76

7+
bash /workspaces/ShowScript/sandbox/scripts/configure-terminals.manager.sh
8+
89
chmod 777 /workspaces/ShowScript/sandbox/data/plugins
910

1011
# Run script to build ShowScript
@@ -19,5 +20,3 @@ bash /workspaces/ShowScript/sandbox/scripts/download-plugins.sh
1920
cd /workspaces/ShowScript/sandbox
2021

2122

22-
23-
# Attach the VSCode Console to the Minecraft server

sandbox/scripts/terminals.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"autorun": true,
3+
"terminals": [
4+
{
5+
"name": "Minecraft Server",
6+
"description": "Runs the Minecraft server",
7+
"focus": true,
8+
"open": true,
9+
"command": "/start"
10+
},
11+
{
12+
"name": "Public IP",
13+
"description": "Gets the public IP to connect to the server",
14+
"focus": false,
15+
"open": true,
16+
"command": "bash /workspaces/ShowScript/sandbox/scripts/tunnel-port.sh"
17+
},
18+
{
19+
"name": "bash terminal",
20+
"description": "Gets the public IP to connect to the server",
21+
"focus": false,
22+
"open": true,
23+
"command": "bash"
24+
}
25+
26+
]
27+
}

0 commit comments

Comments
 (0)