From e47481e98e0091f6819470726b7b6e395b228b6a Mon Sep 17 00:00:00 2001 From: TheOnlyMrCat Date: Wed, 24 Jun 2020 19:38:21 +1000 Subject: [PATCH] Added Licence and Readme --- LICENSE | 21 ++++++++++++ README.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3a18f81 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 TheOnlyMrCat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa5f76e --- /dev/null +++ b/README.md @@ -0,0 +1,95 @@ +# Runscript + +Runscript is a tool like `make` which manages run commands. Runscript can also handle building, but it doesn't track file update times (yet?), so you may still want to use make for that (but you can call it from runscript). + +## How to install + +Binaries are available from the [releases](https://github.com/TheOnlyMrCat/runscript) page. I'll add package manager support later. + +## How it works + +### Phases + +Runscripts can be divided into 5 phases: + +1. Build Only +2. Build +3. Build and Run +4. Run +5. Run Only + +Of course, not all phases need to be used. Up to three of these phases will be run on one `run` invocation, depending on the arguments passed to the command: + +| Phase | `-b`, `--build-only` | `--build-and-run` | `-r`, `--run-only` | +| ------------: | :------------------: | :---------------: | :----------------: | +| Build Only | ✓ | | | +| Build | ✓ | ✓ | | +| Build and Run | | ✓ | | +| Run | | ✓ | ✓ | +| Run Only | | | ✓ | + +When no arguments are passed, it assumes `--build-and-run`. + +### Targets + +The first non-option argument is the target. + +The target consists of two parts: A file, and a target, separated by a `:`. A file only can be specified with a trailing `:`, and if there's no `:` the argument is interpreted as a target only. + +When a file is specified, `f`, runscript looks in `f.run`. If no file is specified, runscript looks in the current working directory for `run`. + +```shell +run # Runs the default target of ./run +run test # Runs the target "test" of ./run +run test: # Runs the default target of ./test.run +run test:t # Runs the target "t" of ./test.run +``` + + + +## How it looks + +```run +! This is a single-line comment +! Multi-line comments do not exist +! Comments can only appear outside of blocks + +! Global block. Runs after target block +## +echo Normal shell commands go here +echo Supports $VARIABLES and $(echo subcommands) +echo 'single quoted' and "double quoted" arguments work +echo and "double quoted" args support "$VARS and $(sub)commands" as well +#/ + +! Default command block. Runs if no target is specified +#- +echo "run" doesn't spawn a new command +echo it is instead re-entrant +run target +#/ + +! Phases can be specified on any block +#target b! +echo Build Only +#/ + +! Targets can only be defined once per phase +#target b +echo Build +#/ + +! If no phase is specified, it defaults to Build and Run +#target br +echo Build and Run +#/ + +#target r +echo Run +#/ + +#target r! +echo RunOnly +#/ +``` +