Coder Social home page Coder Social logo

git-stat-motd's Introduction

Git-Stat-motd

Description

  • A script meant to be executed upon session login time (via /etc/profile.d/, ~/.bashrc, etc.)
  • Works on Linux, Windows, and MacOS (You just need to figure out how to execute it when you want it executed)
  • Prints the current status of git repositories contained in the text file you provide it as an argument.

Requirements

Python Interpreter

  • Python 3.6 or greater

Pip Packages

  • Click
  • Colorama

Considerations:

  • You can install the packages via pip on your system interpreter (not recommended)
  • You can prepare a virtual environment and use its python interpreter as the path in the shebang of the script

Shebang for system interpreter

#!/usr/bin/python3

Shebang for the venv located at /home/ubuntu/git-stat-motd/venv

#!/home/ubuntu/git-stat-motd/venv/bin/activate

Using

Just some examples, feel free to use it however you like.

Linux

sudo su root
cd /usr/share/bin
git clone https://github.com/camratchford/git-stat-motd.git
cd git-stat-motd
python3 -m venv venv
./venv/bin/pip install -r requirements.txt

# Open up git-status-motd.py with text editor of your choice
# Change first line with:
# #!/usr/share/bin/git-stat-motd/venv/bin/python

# Create a repos.txt with text editor of your choice
# Put the absolute path of each repository you wish to receive stats for

echo "/usr/share/bin/git-stat-motd/git-stat-motd.py -r /usr/share/bin/git-stat-motd/repos.txt" \
  > /etc/profile.d/motd.sh

Windows (PowerShell profile)

cd $ENV:USERPROFILE
git clone https://github.com/camratchford/git-stat-motd.git
cd git-stat-motd
python3 -m venv venv
.\venv\scripts\pip install -r requirements.txt

# Create a repos.txt with text editor of your choice
# Put the absolute path of each repository you wish to receive stats for

$GitStatDir = "$ENV:USERPROFILE\git-stat-motd"

if (!(Test-Path $PROFILE)) {
    New-Item $PROFILE -ItemType File
}
$GitStatCmd =  "$GitStatDir\venv\scripts\python $GitStatDir\git-stat-motd.py -r $GitStatDir\repos.txt"
Add-Content -Path $PROFILE -Value $GitStatCmd

git-stat-motd's People

Contributors

camratchford avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.