hookstack-cli 0.1.11 → 0.1.12
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/bin/cli.mjs +5 -4
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'
|
|
2
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, realpathSync } from 'fs'
|
|
3
3
|
import { createInterface } from 'readline'
|
|
4
4
|
import { homedir } from 'os'
|
|
5
5
|
import { join, dirname } from 'path'
|
|
@@ -247,7 +247,8 @@ async function main() {
|
|
|
247
247
|
else await directInstall(args.hooks, args)
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
/* v8 ignore next
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
/* v8 ignore next 4 */
|
|
251
|
+
const _argv1 = (() => { try { return realpathSync(process.argv[1]) } catch { return process.argv[1] } })()
|
|
252
|
+
if (_argv1 === fileURLToPath(import.meta.url)) {
|
|
253
|
+
main().catch(err => { console.error(pc.red(`\n✗ ${err.message || err}`)); process.exit(1) })
|
|
253
254
|
}
|