comgen

1.2.1 • Public • Published

Commit generator

Tired of creating a lot of commits to make your github profile look cool? This script will generate as many commits as you want in the number of days that you assign. This script will also create random messages for your commits.

Getting Started

Run the following npm command to install

npm i comgen

URL: https://www.npmjs.com/package/comgen

OR

1.Fork this repo https://github.com/pevargasg/auto-commitGenerator
2.Clone the forked repo into your local environment
3.Run npm install
4.Open the commit-generator.sh file under your node_modules/comgen
5.Modify the variables

days = represent the number of days, the number of commits will be assigned
hours = represent the number of hours, the number of commits will be assigned
minutes = represent the number of minutes, the number of commits will be assigned
totalNumberOfCommits = number of commits

NPM Run

In you package.json you can add the following line under scripts:

"scripts": {
    "comgen": "sh node_modules/comgen/commit-generator.sh"
 }

This will run the the shell file by doing npm run comgen

Examples of Usage

npm run comgen d 365 h 24 m 60 c 100
npm run comgen
npm run comgen days 365 hours 24 minutes 60 commits 100
Note that the deafault values are days :365, hours: 24, minutes: 60 and total commits: 300

d: days
h: hours
m: minutes
c: number of commits

Shell Script

days=365
hours=24
minutes=60
commits=300

while [ $# -ne 0 ]; do
  case "$1" in
    "d"|"days") days=$2; shift 2;;
    "h"|"hours") hours=$2; shift 2;;
    "m"|"minutes") minutes=$2; shift 2;;
    "c"|"commits") commits=$2; shift 2;;
    *) break;;
  esac
done

lenghtOfTime=$((days*hours*minutes))
arrayOfCommits=$(shuf -i 1-$lenghtOfTime -n $commits | sort -r -n)

echo "Days: $days"
echo "Hours: $hours"
echo "Minutes: $minutes"
echo "Commits: $commits"

for index in $arrayOfCommits
  do
    randomMessage=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
    git commit --allow-empty --date "$(date -d "-$index minutes")" -m "$randomMessage"
  done
git push origin master

Contributing

Contact me wearetamo@gmail.com to make any contribution to this repo

Authors

  • Patricio Vargas - Initial work

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the https://github.com/pevargasg/auto-commitGenerator/blob/master/LICENSE file for details


Readme

Keywords

none

Package Sidebar

Install

npm i comgen

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

5.22 kB

Total Files

4

Last publish

Collaborators

  • pevargasg