Skip to content

melbahja/ron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ron

The simple command line task runner.

InstallationUsageBash AutocompleteLicense

Installation

Start by download latest version for your OS:

# Linux
curl -fSL https://github.com/melbahja/ron/releases/latest/download/ron_linux -o ron


# MacOS
curl -fSL https://github.com/melbahja/ron/releases/latest/download/ron_macos -o ron


# Windows
curl -fSL https://github.com/melbahja/ron/releases/latest/download/ron_windows.exe -o ron.exe

Then make the binary executable and move it to bin path:

chmod +x ron
sudo mv ron /usr/bin/ron

for Gophers you can go get github.com/melbahja/ron.

Usage

Ron is a very simple task runner that execute any executable file inside a .ron directory for example if you have this tree in your project:

.ron/
├── foo/
│   ├── .default
│   ├── bar
│   └── baz
├── .default
└── serve

.default file is the default executable for directories.

To execute .ron/.default run:

ron

To execute .ron/serve file run:

ron serve

To execute .ron/foo/.default run:

ron foo

To execute .ron/foo/bar run:

ron foo bar

Note: also you can use binary files inside .ron directory.

See Ron's .ron directory.

Bash Autocomplete

Add this to your bash profile (.bashrc):

_ron_bash_autocomplete() {
  if [[ "${COMP_WORDS[0]}" != "source" ]]; then
    local cur opts base
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    if [[ "$cur" == "-"* ]]; then
      opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion )
    else
      opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
    fi
    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
    return 0
  fi
}

complete -F _ron_bash_autocomplete ron

License

Ron is provided under the MIT License.