create-rigorail 0.1.0 → 0.2.0
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.mjs +8 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
mkdirSync,
|
|
10
10
|
readdirSync,
|
|
11
11
|
readFileSync,
|
|
12
|
+
realpathSync,
|
|
12
13
|
rmSync,
|
|
13
14
|
writeFileSync,
|
|
14
15
|
} from 'node:fs'
|
|
@@ -190,10 +191,13 @@ Then open it with your coding agent and start with:
|
|
|
190
191
|
Prompts for common tasks: README.md#prompts-for-your-agent`)
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
)
|
|
194
|
+
// npm runs bins through a node_modules/.bin symlink, so compare real paths.
|
|
195
|
+
const isEntryPoint = (scriptPath) =>
|
|
196
|
+
Boolean(scriptPath) &&
|
|
197
|
+
existsSync(scriptPath) &&
|
|
198
|
+
realpathSync(scriptPath) === realpathSync(fileURLToPath(import.meta.url))
|
|
199
|
+
|
|
200
|
+
if (isEntryPoint(process.argv[1]))
|
|
197
201
|
main().catch((error) => {
|
|
198
202
|
console.error(`\n${error instanceof Error ? error.message : error}`)
|
|
199
203
|
process.exitCode = 1
|