openclaw-sync-assistant 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/index.js +11 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -48,8 +48,17 @@ module.exports = {
48
48
  }
49
49
  }
50
50
 
51
- // 如果未配置,则在安装/首次加载时触发引导向导
52
- if (!hasConfigured) {
51
+ // 判断当前进程是否为 OpenClaw 的长期后台进程 (daemon),而不是执行一次性命令 (如 plugins list/update)
52
+ // 之前使用 process.argv 判断不够准确,有些环境下(如全局安装的 openclaw 命令)真正的参数可能被隐藏或包装
53
+ // 更稳妥的做法是检查环境变量,通常 daemon 启动时会带有特定的环境或特征
54
+ // 但如果环境变量不可靠,我们可以检查 process.argv 里面是否*不包含* 'plugins'
55
+ // 因为执行 'openclaw plugins xxx' 时,'plugins' 一定在参数列表中
56
+ const isPluginCommand = process.argv.some(
57
+ (arg) => arg.includes("plugins") || arg.includes("plugin"),
58
+ );
59
+
60
+ // 只有当不是执行插件管理命令,且未配置时,才触发引导向导
61
+ if (!hasConfigured && !isPluginCommand) {
53
62
  isWizardRunning = true;
54
63
  try {
55
64
  await module.exports.runSetupWizard(context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-sync-assistant",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "An OpenClaw plugin for P2P file and data synchronization using Hyperswarm and Hyperdrive ecosystem.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",