Skip to content

Instantly share code, notes, and snippets.

View jakeboone02's full-sized avatar

Jake Boone jakeboone02

View GitHub Profile
@fabiospampinato
fabiospampinato / fast-npm-run.sh
Last active March 27, 2024 16:38
20x faster replacement for "npm run"
# 20x faster replacement for "npm run"
# - It supports scripts executing a built-in shell function
# - It supports scripts executing a binary found in PATH
# - It supports scripts executing a binary found in node_modules
# - It supports passing arguments and options to scripts
# - It supports reading scripts either via ripgrep (fast) or via jq (slower, but safer)
# - It adds ./node_modules/.bin to the $PATH
# - It handles gracefully when a script has not been found
# - It handles gracefully when "&", "&&", "|", "||", or ENV variables are used, falling back to "npm run"
@jerrythomas
jerrythomas / merge-lcov.sh
Last active October 30, 2023 16:01
merge lcov.info from packages under a monorepo into a single one.
#!/bin/bash
files=`find ./ -name lcov.info`
args=""
for f in $files; do
prefix=`echo $f | sed -e s/coverage.lcov.info// | sed -e s#^\./##`
echo "fixing paths in $f"
sed -i.bak "s#^SF\:src#SF\:${prefix}src#g" $f
args="$args -a $f"
done