Code Monkey home page Code Monkey logo

runscript's Introduction

Runscript

Runscript is a tool like make (or, perhaps, just) which manages project-specific commands. When you want to run your program, simply type run.

For an example of a useful runscript, see the runfile for this repository.

Features

  • Does not use Makefile syntax, and instead uses a custom TOML-inspired syntax with no significant whitespace
  • Emulates a shell and executes commands directly, instead of invoking sh.
  • Supports most of the shell features you know and love (parsing adapted from ipetkov/conch_parser)
  • Can invoke an external tool (not necessarily a shell!) to run a script, if the builtin shell proves inadequate.
  • Multiple 'phases' per target, so you can chose to build, run, or test a target. If those options aren't enough, you can name your phases whatever you want!
  • Imports targets from multiple files, meaning you can have a personal .run file alongside a source-controlled run file
  • Fancy output while running scripts, which is entirely configurable!

Still to do

  • A number of more advanced shell features, including:
    • A few shell builtin commands (e.g. exit, nohup)
    • Local variables (?)
    • Arithmetic and a number of parameter substitutions
    • Here-documents
  • Replace manual SIGHUP'ing with setpgid
  • Remove most sources of panicking (fuzz testing?)
  • Support Windows properly (?)

Non-goals

Despite having -c and -s options for executing single commands and shell scripts, respectively, Runscript won't emulate a POSIX shell perfectly. I'll try to make it useful enough for most use cases, but if you want a POSIX shell, just use a POSIX shell. That being said, feel free to test the limitations of those two flags! I do have to be able to execute shell scripts to implement the source builtin.

How to install

AUR

Runscript is on the AUR as runscript-git. Install it manually, or using your favourite AUR helper.

paru -S runscript-git

Manually

git clone https://git.sr.ht/~theonlymrcat/runscript
cd runscript
cargo install --release

License

Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

runscript's People

Contributors

theonlymrcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

runscript's Issues

Panic when running script with no commands

I made a target that was empty and then ran it and it died

Runscript panicked.
Crate version: 2.0.0-beta.2
Operating System: Arch Linux Rolling Release [64-bit]

Panic message:
panicked at 'called `Option::unwrap()` on a `None` value', src/exec.rs:524:52

Command arguments don't support glob patterns

I have a line which takes src/*.cpp as an argument, but I get the error clang: error: no such file or directory: 'src/*.cpp'. It's referring to the right directory because if I use a single file as the argument it picks up the file (but obviously all its includes are missing).

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.