#54 run multiple snippets

This commit is contained in:
lollipopkit
2023-07-08 00:12:15 +08:00
parent cb16b3a8b6
commit fefd3f9701
25 changed files with 326 additions and 116 deletions

View File

@@ -276,11 +276,11 @@ class ServerProvider extends BusyProvider {
}
}
Future<String?> runSnippet(String id, Snippet snippet) async {
Future<String?> runSnippets(String id, List<Snippet> snippets) async {
final client = _servers[id]?.client;
if (client == null) {
return null;
}
return await client.run(snippet.script).string;
return await client.run(snippets.map((e) => e.script).join('&&')).string;
}
}