"How do I [build/install/release] this source repo i just cloned?"
Just ask how [to]
$ how to
Found Actions:
________________________________________
build : Build the project with Gradle
test : Test the project with Gradle
install : Build and install locally with Gradle.
local : Run local installation
release : Release the project.
pond : Toss a coin in the pond!
________________________________________
tip: see more: how to [action]
tip: do the action: how do [action] [args]
tip: use how to -v for more information
Get more info with how to [action].
$ how to build
build:
Build the project with Gradle
./gradlew build
________________________________________
tip: do the thing with: how do [action] [args]
tip: or just: how [action] [args]Run it with how do or just how [action]
$ how do pond
Today you will have:
A little luck.- Run
brew tap rundeck/howto-cli-tool - Run
brew install howto
how uses various "detectors" to look for actions that the user could do.
- It looks for a
howto.mdfile (or name variation of that), or areadme.mdfile- If there is a "how to" H1 section, it looks for H2s within that 2. Each H2 section with a code block is treated as an action.
- Otherwise any H2 section with a title containing "how to" and a code block is treated as an action
- Otherwise, it checks various build tools, such as:
- Gradle
- NPM
- ... (add your own!)
- It introspects available actions for the build tool(s) found
See the Releases section.
Create a "howto.md" or "readme.md". You can also name the file with a variation such as howto.markdown or just HOWTO (but the file must use Markdown formatting).
If howto sees both a howto.md and readme.md, it will use howto.md.
Any H2 section with the words "how to" in the title that contains a code block will be treated as an action.
You can also use a H1 section where the title has the words "how to", in which case all H2 sections with code blocks below it will be selected.
The heading of the H2 section will be the name of the action.
## Build
Within the H2 section, use a code block (indented of fenced), or simple code section to define the action to invoke.
```
make dist
```
If you want to accept arguments use "${@}" (for bash). Pass arguments using how do [action] -- [args] or how [action] -- [args].
`sh build.sh "${@}"`
If you want to reference the directory containing the HOWTO doc that is used, an environment variable is set: DIR
```
cat "${DIR}/somefile"
```
If no "howto.md" or # Howto section in the readme is found,
Howto will look for common build tools, and try to introspect them.
Currently these tools are supported:
- NPM - looks for the
package.jsonfile and any "scripts" defined within it - Gradle(w) - looks for
build.gradlefile and any parent dir containingsettings.gradleandgradlew, then lists available tasks withgradlew tasks
TODO:
- Gradlew.bat wrapper for gradle (windows)
-
gradlewithout a wrapper - Maven
- Your favorite build tool...