opencode-pixel-office 1.0.2 → 1.0.3
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/opencode-pixel-office.js +0 -22
- package/package.json +1 -1
|
@@ -62,27 +62,6 @@ const copyRecursiveSync = (src, dest) => {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const updateConfig = async () => {
|
|
66
|
-
if (skipJson) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (!fs.existsSync(DEFAULT_CONFIG_PATH)) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
const raw = fs.readFileSync(DEFAULT_CONFIG_PATH, "utf8");
|
|
74
|
-
const data = JSON.parse(raw);
|
|
75
|
-
const list = Array.isArray(data.plugin) ? data.plugin : [];
|
|
76
|
-
if (!list.includes(PLUGIN_ID)) {
|
|
77
|
-
data.plugin = [...list, PLUGIN_ID];
|
|
78
|
-
fs.writeFileSync(DEFAULT_CONFIG_PATH, `${JSON.stringify(data, null, 2)}\n`, "utf8");
|
|
79
|
-
console.log(`✓ Added ${PLUGIN_ID} to opencode.json`);
|
|
80
|
-
}
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.warn(`Failed to update ${DEFAULT_CONFIG_PATH}:`, error);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
65
|
const run = async () => {
|
|
87
66
|
if (!shouldInstall) {
|
|
88
67
|
printHelp();
|
|
@@ -164,7 +143,6 @@ const run = async () => {
|
|
|
164
143
|
|
|
165
144
|
console.log(`✓ Standalone app installed to ${DEFAULT_APP_DIR}`);
|
|
166
145
|
|
|
167
|
-
await updateConfig();
|
|
168
146
|
console.log("\nSuccess! Restart OpenCode to launch Pixel Office.");
|
|
169
147
|
};
|
|
170
148
|
|