Run commands repeatedly

This commit is contained in:
Andrew Tomaka 2022-03-12 11:24:22 -05:00
parent e9b32586ab
commit db8166fce8
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -78,6 +78,18 @@ function password-generator {
echo $password echo $password
} }
function run {
if [ $# -lt 2 ]; then
echo Usage: run NUMBER COMMAND
else
number=$1; shift
for i in `seq $number`; do
eval "$@"
done
fi
}
function test-rails { function test-rails {
if bundle exec rspec --help > /dev/null 2>&1; then if bundle exec rspec --help > /dev/null 2>&1; then
if [ -d spec ]; then if [ -d spec ]; then