Skip to content

Commit

Permalink
fix: add scripts field if not present (#1338)
Browse files Browse the repository at this point in the history
* fix: add scripts field if not present

* Update bin.js

---------

Co-authored-by: typicode <typicode@gmail.com>
  • Loading branch information
chalkygames123 and typicode committed Jan 25, 2024
1 parent e8d4150 commit d9941e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let a = process.argv[2]
if (a == 'init') {
let p = process.env.npm_package_json
let d = JSON.parse(f.readFileSync(p))
d.scripts ||= {}
d.scripts.prepare = 'husky'
w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2))
process.stdout.write(i())
Expand Down

0 comments on commit d9941e2

Please sign in to comment.