Git plug tweaks

This commit is contained in:
Zef Hemel
2022-03-28 08:51:24 +02:00
parent 6dd56e85de
commit 16fa05d4cc
9 changed files with 68 additions and 25 deletions
+1 -1
View File
@@ -41,6 +41,6 @@ functions:
welcome:
path: "./server.ts:welcome"
events:
- load
- plug:load
env: server
+5 -2
View File
@@ -11,7 +11,10 @@ export function endpointTest(req: EndpointRequest): EndpointResponse {
};
}
export function welcome() {
console.log("Hello world!");
export function welcome(plugName: string) {
if (plugName !== "core") {
return;
}
console.log("Hello world!!", plugName);
return "hi";
}
-3
View File
@@ -1,3 +0,0 @@
export default function welcome() {
console.log("Hello world!");
}
+2 -1
View File
@@ -27,12 +27,13 @@ export async function snapshotCommand() {
}
export async function syncCommand() {
await syscall("editor.flashNotification", "Syncing with git");
await syscall("system.invokeFunctionOnServer", "sync");
await syscall("editor.flashNotification", "Git sync complete!");
}
export async function sync() {
console.log("Going to sync with git");
console.log("First locally committing everything");
await commit();
console.log("Then pulling from remote");
await syscall("shell.run", "git", ["pull"]);