Giter Site home page Giter Site logo

xuerun's Introduction

XueRun ( 雪 run )

Just a make-like task runner but with more power! It's written in CoffeeScript + Deno.

Downloads

Go to Release page and download builds! And move it to ur path. Eg. /usr/bin, /usr/local/bin, etc. For windows, the same :P.

Configurations

General usage is:

xuerun [tasks]... [options]...

TL;DR

$ xuerun                      # will execute 'all' task if exist
$ xuerun task-name-to-execute # will execute 'task-name-to-execute'
$ xuerun -t some-tasks-path   # will look for task in 'some-tasks-path'
$ xuerun -n some-task         # will print commands to run ( won't execute )

Tasks Path ( --tasks, -t option )

Unless --tasks ( -t ) is given, XueRun will look for tasks.xuerun. If tasks.xuerun exists, XueRun will use that.

$ xuerun someName # xuerun will look for someName in tasks.xuerun
$ xuerun -t example.xuerun someName # xuerun will look for someName in example.xuerun

Task Name ( [tasks] )

Unless task names are given, XueRun will look for a task named all. If all task exists, XueRun will execute that.

$ xuerun task-name-to-execute

You can give multiple task name too.

$ xuerun taskOne taskTwo taskThree # these tasks will run in sequantial order.

Recon ( --recon, -n option )

Use --recon ( -n ) to emulate task execution ( but won't work in some edge cases ).

$ xuerun -n some-task # xuerun will print commands instead of executing

Complete Configurations Example

dependOnMeToo:
  description: another task
  # cwd: /some/path/too
  command:
  - cmd: echo "I can read {{ opt.release }} if 'dependOnMe' task call me"
    when: opt.release # if opt.release is true
  - cmd: echo "Since passParentOptions is true in 'dependOnMe' task"
    when: opt.release # if opt.release is true
  passEnv: [ PATH ] # u need to pass env to use ur PATH. Pass true to pass all environment variables
dependOnMe:
  description: some task
  # cwd: / # try change cwd and see {{ Deno.cwd() }} output!
  shell: bash # default shell
  dependencies:
  - name: dependOnMeToo
    passParentOptions: true
  command:
  - cmd: echo "I can read {{ opt.FOO }}"
    shell: zsh # u can use another shell rather than default one
  - cmd: echo "Don't run me unless status is 'true'"
    when: opt.status == 'true'
  - echo "I'm a command too. In {{ Deno.cwd() }}" # deno expressions are supported
taskName:
  description: a description
  dependencies:
  - name: dependOnMe
    options:
      FOO: bar
      status: "{{ opt.status == 1 }}"
      release: "{{ opt.release }}" # u can use --release CLI option if passCLI is true
  passCLI: true
  command: echo "this is main task"

I think this example show u a lot! Have Fun xuerunning!

Some Notes

Here's some notes to be considered.

Option passing

If u specified passEnv and passCLI, given env and CLI arguments will be passed to opt object and can be used with {{}}

When Option ( WARNING )

This taskName > command > subcommand > when ( when ) expression is evaluated using eval function from javascript and can inject raw JS codes. So, use at ur own risk.

- cmd: echo "Don't run me unless status is 'true'"
  when: opt.status == 'true'

JS Expression

You can use {{ expression }} in commands, options, etc. XueRun use eta to render those. string templates. Keep in mind, raw JS code can be injected too. So, use at ur own risk.

command:
- cmd: echo "it's PATH env => {{ opt.PATH }}  and CLI release option => {{ opt.release }}"
passEnv: [ PATH ]
passCLI: true

Then, when u run with xuerun taskName --release, opt.PATH will be replaced with ur PATH env and opt.release will be replaced with true.

How to Build

First, clone this repo. Then, run "tools/bootstrap.ts"

deno run tools/bootstrap.ts

License

XueRun is licensed under BSD-2-Clause. For more, see LICENSE.

xuerun's People

Contributors

heinthanth avatar

Watchers

 avatar  avatar

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.