@aiyiran/myclaw 1.1.85 → 1.1.86
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/index.js +10 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1891,8 +1891,18 @@ async function ensureConfig(customName) {
|
|
|
1891
1891
|
|
|
1892
1892
|
function runSyncTemplates() {
|
|
1893
1893
|
const http = require('http');
|
|
1894
|
+
const fs = require('fs');
|
|
1894
1895
|
const apiPort = process.platform === 'linux' ? '8080' : '18800';
|
|
1895
1896
|
|
|
1897
|
+
// --force:删除本地 index,强制重新比对
|
|
1898
|
+
if (args.includes('--force')) {
|
|
1899
|
+
const localIndex = path.join(os.homedir(), '.openclaw', 'skills', 'yiran-playground-template-use', 'template-index.json');
|
|
1900
|
+
if (fs.existsSync(localIndex)) {
|
|
1901
|
+
fs.unlinkSync(localIndex);
|
|
1902
|
+
console.log(colors.yellow + '[muban] 已清除本地 index,强制重新检查' + colors.nc);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1896
1906
|
function apiGet(path, cb) {
|
|
1897
1907
|
http.get('http://127.0.0.1:' + apiPort + path, (res) => {
|
|
1898
1908
|
let data = '';
|