Last active
August 31, 2021 00:46
-
-
Save Oaphi/2fd2c8712e71375f77cfdf42f60657be to your computer and use it in GitHub Desktop.
Various bash helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extracts NPM environment variable names | |
npm_val() { | |
local value=$(ENV | grep -e "npm_package_$1" | cut -d "=" -f 2) | |
echo $value | |
} | |
# splits a string on dashes and rejoins with first letter uppercased | |
pretty() { | |
IFS=\- | |
local output | |
for c in $1; do | |
output="$output ${c^}" | |
done | |
echo $output | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment