@@ -18,6 +18,7 @@ async function main() {
1818 sourceListPath,
1919 targetPath,
2020 restart,
21+ command,
2122 targets,
2223 decompressTarget,
2324 } = settings ;
@@ -68,6 +69,7 @@ async function main() {
6869 }
6970 }
7071
72+ if ( command != "" ) await sendConsoleCommand ( serverId , command ) ;
7173 if ( restart ) await restartServer ( serverId ) ;
7274 }
7375
@@ -81,6 +83,7 @@ async function getSettings() {
8183 const panelHost = getInput ( "panel-host" , { required : true } ) ;
8284 const apiKey = getInput ( "api-key" , { required : true } ) ;
8385 const restart = getInput ( "restart" ) == "true" ;
86+ const command = getInput ( "command" ) ;
8487 const proxy = getInput ( "proxy" ) ;
8588 const decompressTarget = getInput ( "decompress-target" ) == "true" ;
8689 const followSymbolicLinks = getInput ( "follow-symbolic-links" ) == "true" ;
@@ -93,6 +96,7 @@ async function getSettings() {
9396
9497 // Debug print out all the inputs
9598 core . debug ( `restart: ${ restart } ` ) ;
99+ core . debug ( `command: ${ command } ` ) ;
96100 core . debug ( `source: ${ sourcePath } ` ) ;
97101 core . debug ( `sources: ${ sourceListPath } ` ) ;
98102 core . debug ( `target: ${ targetPath } ` ) ;
@@ -141,6 +145,7 @@ async function getSettings() {
141145 panelHost,
142146 apiKey,
143147 restart,
148+ command,
144149 proxy,
145150 sourceListPath,
146151 targetPath,
@@ -253,6 +258,12 @@ async function restartServer(serverId) {
253258 } ) ;
254259}
255260
261+ async function sendConsoleCommand ( serverId , command ) {
262+ await axios . post ( `/api/client/servers/${ serverId } /command` , {
263+ command : command ,
264+ } ) ;
265+ }
266+
256267async function decompressFile ( serverId , targetFile ) {
257268 await axios . post ( `/api/client/servers/${ serverId } /files/decompress` , {
258269 root : "/" ,
0 commit comments