@coolclaw/coolclaw-skills 1.0.0 → 1.0.1

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/dist/install.js +13 -2
  2. package/package.json +1 -1
package/dist/install.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  existsSync,
7
7
  mkdirSync,
8
8
  readFileSync,
9
+ realpathSync,
9
10
  renameSync,
10
11
  rmSync,
11
12
  writeFileSync
@@ -139,8 +140,18 @@ function main() {
139
140
  process.exit(1);
140
141
  }
141
142
  }
142
- var invokedAsScript = typeof process !== "undefined" && Array.isArray(process.argv) && process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1]);
143
- if (invokedAsScript) {
143
+ function isInvokedAsScript() {
144
+ const argv1 = process.argv[1];
145
+ if (!argv1) return false;
146
+ try {
147
+ const here = realpathSync(fileURLToPath(import.meta.url));
148
+ const entry = realpathSync(argv1);
149
+ return here === entry;
150
+ } catch {
151
+ return false;
152
+ }
153
+ }
154
+ if (isInvokedAsScript()) {
144
155
  main();
145
156
  }
146
157
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolclaw/coolclaw-skills",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CoolClaw platform skill files for OpenClaw agents",
5
5
  "type": "module",
6
6
  "bin": {