Last active
October 4, 2022 15:56
-
-
Save mrhammadasif/23e948eed927db04ca17ecd291f31431 to your computer and use it in GitHub Desktop.
Generate fake data using Chance-CLI and copy to clipboard (MacOS)
This file contains 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
fake() { | |
if [[ -z $1 ]]; then | |
echo "Provide a chance generator:" | |
exit 1 | |
fi | |
tocopy=$(chance "$@") | |
echo $tocopy | |
echo $tocopy | tr -d '\n' | pbcopy | |
echo "\nCopied to Clipboard!" | |
} |
Update 2022-10-04: removed new-line characters when using pbcopy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to use it:
chance-cli
usingnpm i -g chance-cli
~/.zshrc
)You can then use chance-cli generators for you
fake company
fake name
fake guid
fake string
and it will be copied to your clipboard as well