Skip to content

Commit

Permalink
Project: Extracted duplicated shell script into a separate NPM script
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter committed Jul 9, 2024
1 parent c524004 commit 4922cd2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

"pregenerate-favicon": "mkdir -p assets/images/favicon",
"generate-favicon": "real-favicon generate sources/favicon/faviconDescription.json sources/favicon/faviconData.json assets/images/favicon",
"postgenerate-favicon": "for file in assets/images/favicon/browserconfig.xml assets/images/favicon/site.webmanifest; do perl -pi -e 'print \"---\\n---\\n\\n\" if $. == 1' \"$file\"; perl -pi -e 's/\\/assets\\/.+(?=\\?v=\\d+)/{% link $& %}/g' \"$file\"; done",
"postgenerate-favicon": "for file in assets/images/favicon/browserconfig.xml assets/images/favicon/site.webmanifest; do perl -pi -e 'print \"---\\n---\\n\\n\" if $. == 1' \"$file\"; done",
"preinject-favicon": "mkdir -p _includes && touch _includes/custom-head.html",
"inject-favicon": "real-favicon inject sources/favicon/faviconData.json _includes _includes/custom-head.html",
"postinject-favicon": "for file in _includes/custom-head.html; do perl -pi -e 's/<\\/?(html|head|body)>\\n?//g' \"$file\"; perl -pi -e 's/\\/assets\\/.+(?=\\?v=\\d+)/{% link $& %}/g' \"$file\"; done",
"update-favicon": "npm run generate-favicon && npm run inject-favicon",
"postinject-favicon": "for file in _includes/custom-head.html; do perl -pi -e 's/<\\/?(html|head|body)>\\n?//g' \"$file\"; done",
"linkify-favicon": "for file in assets/images/favicon/browserconfig.xml assets/images/favicon/site.webmanifest _includes/custom-head.html; do perl -pi -e 's/\\/assets\\/.+(?=\\?v=\\d+)/{% link $& %}/g' \"$file\"; done",
"update-favicon": "npm run generate-favicon && npm run inject-favicon && npm run linkify-favicon",

"check-favicon-update": "real-favicon check-for-update --fail-on-update sources/favicon/faviconData.json"
},
Expand Down

0 comments on commit 4922cd2

Please sign in to comment.