Giter Club home page Giter Club logo

cpm's Introduction

CPM - The Cow Package Manager

                                                   _________________________________
                                                  | Updating and managing your cows |
                                             o  o | just got easy and lot more fun. |
                                    #####  o       ---------------------------------
                                   #### _\_
                                   ##=-[•]•]   :::
                                   #(    _\   `'_:
                                    #  \__|    | |
                                     \___/     | |
                                    .'   `-----' |
                                  ( )     ,------'
                                  | |     |         _     _
                                  | |     |        ((_____))
                                  | |     |         [o   o]
                                  |_|==o=={        / \   /
                                  :..     |       /  (o o)
                     .------------'''  Y---------'     U
                    |               |  |              /
                   |                |  |             |
                  :|                }  )            |
                 : |       _        |  |           |
                :  |      / \       |__|_          |
               :   |     /   \      [____)         |
             :     |   /\___/\______________\   |  |
            #      |  /  uuu                 |  |  |
                    | |   | |                |  |  |
                    | |   | |                 | || |
                    | |   | |                 | || |
                    |\\   |\\                 |\\|\\ 

We have package managers for everything nowadays, then why keep our beloved cows behind...they are no less (believe me, I know !).

CPM in action


Naming conventions

  • The barn refers to the project's home directory (~/cpm).
  • Fortune cookie (or simply cookie) refer to a category of fortune messages.
    You can view which categories will be taken into account and their respective probabilities while generating cookies by executing fortune -f.

How it works ?

You can fetch a cow right into your barn (make sure you spell correctly, cows hate it when you misspell their names) -

./cpm fetch <cow_name>

You can also update your entire barn with all the new cows lurking out there -

./cpm fetch

Perhaps you might also find the above command useful in case some of your cows fled without you knowing (believe it or not, there have been many such reported cases !).

Each time you fire up your login shell, the cow_selector script runs. It randomly generates a fortune message, and gets the respective fortune cookie. It then looks in the cookie_index for all the cows that correspond to that cookie and randomly picks one.

But there is a catch !!

While generation of a random cookie is taken care of by the fortune command, the cow which gets displayed along is decided by the cow_selector script. And for that to happen the generated cookie needs to be associated with atleast one cow. The more entries there are in cookie_index, the more cow-cookie diversity will be there each time you start your shell.
The cookie_index gets populated when you run update_cookie_index script. In case the generated cookie is not associated with any cow, a randomly generated cow is used.
So, for the results to get better, more and more cookie entries are required in the cow files. And this is where your valuable contributions come in. Add cookies which you think are most suitable for your favourite cows. The more entries you make, the better your (and everyone's) shell will become.
Currently, the cookie_index is extremely minimal with a single populated entry.

Requirements

  • cowsay
  • fortune (available by default in most distros)

Installation

The installation script is brief -

git clone https://github.com/shivrai/cpm.git && cd cpm
./install

Uninstallation

Alas, not every association is meant to last forever. Hope you enjoyed your cows!

./uninstall

Contributing

Have a new ASCII art ? Want to associate a cow with new cookies ? Pull requests are more than welcome.

After adding new cows, update cow_index by running -

ls cows >! cow_index

After adding adding cookies to cow files, run the following command -

./update_cookie_index

This will automatically update the cookie_index with all the new cow(s) associated with their corresponding cookies.

Some conventions to be taken care of while making changes -

  • When adding new cookies to cow files, make sure you use a , for delimiting.
  • Avoid using . in cow names.
  • Do not manually tamper with the cow_index. This may break some functionality and produce odd results.

Todo

  • Add feature for specifying probability/score along with cows associated with each cookie to control their chances of occurrence.
  • If a cookie is removed from a cow, add functionality in update_cookie_index to automatically make relevant changes in cookie_index.

Acknowledgements

The sole aim of this project is to make one big easy to maintain index of all the diverse cows out there. All credits for the ASCII arts used goes to their respective designers.

All the ASCII arts were taking from the following websites -

cpm's People

Contributors

aniketp avatar shivansh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

aniketp

cpm's Issues

Install script does not work

Running ./install produces sed: 1: "$HOME/.zshrc": extra characters at the end of p command

Using ZSH, steps to recreate:

  • run zsh && cd $HOME && git clone https://github.com/shivrai/cpm.git
  • run cpm/install

You should get the error sed: 1: "$HOME/.zshrc": extra characters at the end of p command.

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.