@goodnesshq/opencode-notification 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ocn.mjs +17 -11
- package/package.json +1 -1
package/bin/ocn.mjs
CHANGED
|
@@ -54,7 +54,7 @@ async function writeJson(path, data) {
|
|
|
54
54
|
await writeFile(path, content, "utf8");
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
async function
|
|
57
|
+
async function installAssets({ showNextSteps = true } = {}) {
|
|
58
58
|
const cwd = process.cwd();
|
|
59
59
|
const repoName = basename(cwd);
|
|
60
60
|
const opencodeDir = join(cwd, ".opencode");
|
|
@@ -68,14 +68,20 @@ async function install() {
|
|
|
68
68
|
await copyFile(ASSET_NOTIFY_INIT, join(opencodeDir, "notify-init.mjs"));
|
|
69
69
|
await copyFile(ASSET_SCHEMA, join(opencodeDir, "oc-notify.schema.json"));
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
if (showNextSteps) {
|
|
72
|
+
console.log(`Installed OpenCode Notifications installer in ${repoName}.`);
|
|
73
|
+
console.log("Next steps:");
|
|
74
|
+
console.log(" 1) Run: node .opencode/notify-init.mjs");
|
|
75
|
+
console.log(" 2) Add the plugin path to ~/.config/opencode/opencode.json:");
|
|
76
|
+
console.log(" npx @goodnesshq/opencode-notification plugin-path");
|
|
77
|
+
console.log("\nUpdate guidance:");
|
|
78
|
+
console.log(" - npx @goodnesshq/opencode-notification@latest install");
|
|
79
|
+
console.log(" - npm update -g @goodnesshq/opencode-notification");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function install() {
|
|
84
|
+
await installAssets({ showNextSteps: true });
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
async function setup() {
|
|
@@ -103,9 +109,9 @@ async function setup() {
|
|
|
103
109
|
await ensureDir(dirname(GLOBAL_OPENCODE_CONFIG));
|
|
104
110
|
await writeJson(GLOBAL_OPENCODE_CONFIG, config);
|
|
105
111
|
|
|
106
|
-
await
|
|
112
|
+
await installAssets({ showNextSteps: false });
|
|
107
113
|
|
|
108
|
-
console.log("
|
|
114
|
+
console.log("Running repo installer...");
|
|
109
115
|
const notifyPath = join(cwd, ".opencode", "notify-init.mjs");
|
|
110
116
|
const { spawnSync } = await import("node:child_process");
|
|
111
117
|
const result = spawnSync("node", [notifyPath], { stdio: "inherit" });
|