@jkwd/inbase 0.1.0 → 0.1.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/bin/inbase.mjs +11 -2
  2. package/package.json +1 -1
package/bin/inbase.mjs CHANGED
@@ -161,8 +161,17 @@ export async function main(argv = process.argv.slice(2)) {
161
161
  process.exitCode = 1
162
162
  }
163
163
 
164
- const invoked = process.argv[1] ? path.resolve(process.argv[1]) : ''
165
- if (invoked === fileURLToPath(import.meta.url)) {
164
+ export function isCliEntry(argv1 = process.argv[1]) {
165
+ if (!argv1) return false
166
+ const self = fileURLToPath(import.meta.url)
167
+ try {
168
+ return fs.realpathSync(argv1) === fs.realpathSync(self)
169
+ } catch {
170
+ return path.resolve(argv1) === path.resolve(self)
171
+ }
172
+ }
173
+
174
+ if (isCliEntry()) {
166
175
  main().catch((error) => {
167
176
  console.error(error instanceof Error ? error.message : error)
168
177
  process.exit(1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jkwd/inbase",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A first-person 3D map of a codebase, with a visual coding workflow for Cursor.",
5
5
  "repository": {
6
6
  "type": "git",