We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sh.cat
1 parent e1a96fa commit c3b630aCopy full SHA for c3b630a
scripts/smoke-test-npm-scripts.js
@@ -26,10 +26,18 @@ program.parse(process.argv)
26
27
const main = () => {
28
const opts = program.opts()
29
-
30
const cwd = path.resolve(opts.dir)
31
32
- const pkg = JSON.parse(sh.cat(path.join(cwd, 'package.json')))
+ let pkg
+ const packageJson = path.join(cwd, 'package.json')
33
+
34
+ try {
35
+ pkg = JSON.parse(fs.readFileSync(packageJson))
36
+ } catch (err) {
37
+ console.error(`Error reading or parsing ${packageJson}:`)
38
+ console.error(err)
39
+ sh.exit(1)
40
+ }
41
42
// The excluded scripts are either already part of our CI steps or are not safe to run.
43
const exclude = [
0 commit comments