Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hboon/genie
Run commands that are bound to directories
https://github.com/hboon/genie
Last synced: 22 days ago
JSON representation
Run commands that are bound to directories
- Host: GitHub
- URL: https://github.com/hboon/genie
- Owner: hboon
- License: bsd-2-clause
- Created: 2016-03-09T05:19:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-26T07:31:23.000Z (over 7 years ago)
- Last Synced: 2024-12-04T13:48:48.833Z (28 days ago)
- Language: Ruby
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
About
---
As developers, we try to automate and build shortcuts to improve our workflow. Sometimes we always run the same command in a specific project directory and a slightly different command or the same command with slightly different parameters in another.A good example is when pushing code, we might run `git push origin master` for one repository, but for another, we might want to run `hub push origin,deploy master` instead. `genie` helps you do that.
`genie` lets you create commands that are bound to directories. In our example, we can create a `push` command that, depending on which directory we run it in, invoke the correct push command.
[![Gem Version](https://badge.fury.io/rb/command-genie.svg)](https://badge.fury.io/rb/command-genie)
![License](https://img.shields.io/github/license/hboon/boom.svg)Usage
---
Here's how to create a command with `genie`:1. Create a YAML configuration file matching the softlink in your user directory's `.config` directory. e.g. For the command called `push`, you would create `~/.config/push.yml`.
Contents for the YAML file are key-value mappings from a directory path to the command to be ran in that directory (and it's subdirectories):
```
/Users/hboon/code/piggyalarm: git push bb master
/Users/hboon/code/simplymeta: hub push bb,deploy master
~/code/ligify: git push bb master
```You can also run `genie create ` to help you create a sample YAML file.
2. Create a softlink to `genie` with a sensible name and make sure it's in your $PATH, e.g.
```
ln -s genie push
```Installation
---
`gem install command-genie`Dependencies
---
* [commander](https://github.com/tj/commander)License
---
BSDQuestions
---
* Email: [[email protected]](mailto:[email protected])
* Web: [http://hboon.com/genie/](http://hboon.com/genie/)
* Twitter: [https://twitter.com/hboon](https://twitter.com/hboon)