Git Product home page Git Product logo

run's Introduction

run

s/run/the-correct-program/ $@

run dispatches command line arguments to a program, based on the files #!, then based your configuration in your .runrc file(s).
I find this useful for running a number of different types of scripts with the same command in my IDE/Text editor.

For example, I program in Ruby and Node.js. I want to use the same command to run my scripts, despite having to switch between two languages.
All I need to do now is run:

    run my_spec.rb

In my .runrc file, I have a mapping between files with the extension .rb and ruby.

Here is my ~/.runrc file.

    #!/bin/bash
    file=$1
    if [[ $file =~  .rb$ ]]; then exec ruby $@; fi
    if [[ $file =~  .js$ ]]; then exec node $@; fi

run also allows you to configure a separate .runrc file in a directory-specific basis.
For example, I'm working on my fork (http://github.com/btakita/jasmine-node) of the jasmine-node project. 
In order to run specs, I need it to go through the specs.sh script within that project.

To accomplish that, I add the following to the top line of each spec:

    #!/usr/bin/env jasmine-node --forceexit

run's People

Contributors

btakita avatar

Stargazers

Shared Honk Dev Account avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

truecar

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.