项目作者: hikire

项目描述 :
Loyal CLI aliases
高级语言: JavaScript
项目地址: git://github.com/hikire/sebas.git
创建时间: 2018-10-06T17:04:58Z
项目社区:https://github.com/hikire/sebas

开源协议:MIT License

下载


Sebas

Create aliases to commands or tasks(JS/Sh files) using files.

Installation

  1. # For npm users
  2. npm i -g sbas
  3. # For yarn users
  4. yarn global add sbas

Usage

Create a .sebas folder in your $HOME directiory. Then add your commands by creating files that has the shortcut name and contain the intended command:

  1. echo "rpm-ostree status" > status

Then use it anywhere like this:

  1. sbas status

If the command isn’t found inside .sebas folder, sebas will try to run the command as is:

  1. sbas ls # where ls command isn't inside .sebas folder
  2. # will show files like ls does

Using folders to group commands

  1. mkdir os && cd os
  2. echo "rpm-ostree status" > status

and use it like this:

  1. sbas os status

JS tasks

you can add js files inside .sebas they will be executed when called:

  1. echo "console.log(\"Hi :)\")" > hi.js

and use it like this:

  1. sbas hi
  2. Hi :)

sh files

you can run sh files the same way as js ones:

  1. # inside .sebas folder
  2. echo "touch hi.js && ls" > yo.sh

and use it like this:

  1. sbas yo
  2. hi.js # etc...

Change .sebas directory

Add an environmental variable called SEBAS_DIR it will be used by default.

Contributing

  1. Fork it!
  2. Create your feature branch (git checkout -b my-cool-feature)
  3. Commit your changes (git commit -am 'add my feature')
  4. Push to the branch (git push origin my-cool-feature)
  5. Create a new Pull Request