mirror of
https://github.com/go-task/task.git
synced 2025-07-03 00:57:02 +02:00
Update README documentation after changes
This commit is contained in:
20
README.md
20
README.md
@ -40,8 +40,10 @@ Running the tasks is as simple as running:
|
|||||||
task assets build
|
task assets build
|
||||||
```
|
```
|
||||||
|
|
||||||
If Bash is available (Linux and Windows while on Git Bash), the commands will
|
Task uses [github.com/mvdan/sh](https://github.com/mvdan/sh), a native Go sh
|
||||||
run in Bash, otherwise will fallback to `cmd` (on Windows).
|
interpreter. So you can write sh/bash commands and it will work even on
|
||||||
|
Windows, where `sh` or `bash` is usually not available. Just remember any
|
||||||
|
executable called must be available by the OS or in PATH.
|
||||||
|
|
||||||
If you ommit a task name, "default" will be assumed.
|
If you ommit a task name, "default" will be assumed.
|
||||||
|
|
||||||
@ -287,13 +289,9 @@ Task also adds the following functions:
|
|||||||
"darwin" (macOS) and "freebsd".
|
"darwin" (macOS) and "freebsd".
|
||||||
- `ARCH`: return the architecture Task was compiled to: "386", "amd64", "arm"
|
- `ARCH`: return the architecture Task was compiled to: "386", "amd64", "arm"
|
||||||
or "s390x".
|
or "s390x".
|
||||||
- `IsSH`: on unix systems this should always return `true`. On Windows, will
|
- `ToSlash`: Does nothing on Unix, but on Windows converts a string from `\`
|
||||||
return `true` if `sh` command was found (Git Bash). In this case commands
|
|
||||||
will run on `sh`. Otherwise, this function will return `false` meaning
|
|
||||||
commands will run on `cmd`.
|
|
||||||
- `ToSlash`: Does nothing on `sh`, but on `cmd` converts a string from `\`
|
|
||||||
path format to `/`.
|
path format to `/`.
|
||||||
- `FromSlash`: Oposite of `ToSlash`. Does nothing on `sh`, but on `cmd`
|
- `FromSlash`: Oposite of `ToSlash`. Does nothing on Unix, but on Windows
|
||||||
converts a string from `\` path format to `/`.
|
converts a string from `\` path format to `/`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@ -303,9 +301,8 @@ printos:
|
|||||||
cmds:
|
cmds:
|
||||||
- echo '{{OS}} {{ARCH}}'
|
- echo '{{OS}} {{ARCH}}'
|
||||||
- "echo '{{if eq OS \"windows\"}}windows-command{{else}}unix-command{{end}}'"
|
- "echo '{{if eq OS \"windows\"}}windows-command{{else}}unix-command{{end}}'"
|
||||||
- echo 'Is SH? {{IsSH}}'
|
# This will be path/to/file on Unix but path\to\file on Windows
|
||||||
# This will be ./bin/executable on sh but .\bin\executable on cmd
|
- "{{FromSlash \"path/to/file\"}}"
|
||||||
- "{{FromSlash \"./bin/executable\"}}"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Help
|
### Help
|
||||||
@ -358,3 +355,4 @@ Similar software:
|
|||||||
[gotemplate]: https://golang.org/pkg/text/template/
|
[gotemplate]: https://golang.org/pkg/text/template/
|
||||||
[robo]: https://github.com/tj/robo
|
[robo]: https://github.com/tj/robo
|
||||||
[dog]: https://github.com/dogtools/dog
|
[dog]: https://github.com/dogtools/dog
|
||||||
|
[sh]: https://github.com/mvdan/sh
|
||||||
|
Reference in New Issue
Block a user