mirror of
https://github.com/go-task/task.git
synced 2025-02-13 13:59:32 +02:00
feat: add missing syntax highlighters
This commit is contained in:
parent
c7ba42b81a
commit
508ff717c9
@ -11,7 +11,7 @@ toc_max_heading_level: 5
|
|||||||
|
|
||||||
Task command line tool has the following syntax:
|
Task command line tool has the following syntax:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
task [--flags] [tasks...] [-- CLI_ARGS...]
|
task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ tasks:
|
|||||||
- ./foo-printer.bash
|
- ./foo-printer.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
a=foo
|
a=foo
|
||||||
echo $a
|
echo $a
|
||||||
|
@ -14,7 +14,7 @@ Task offers many installation methods. Check out the available methods below.
|
|||||||
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting
|
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting
|
||||||
Task is as simple as running:
|
Task is as simple as running:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
brew install go-task/tap/go-task
|
brew install go-task/tap/go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -25,24 +25,25 @@ Recently, Task was also made available
|
|||||||
[on the official Homebrew repository](https://formulae.brew.sh/formula/go-task),
|
[on the official Homebrew repository](https://formulae.brew.sh/formula/go-task),
|
||||||
so you also have that option if you prefer:
|
so you also have that option if you prefer:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
brew install go-task
|
brew install go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tea
|
### Tea
|
||||||
|
|
||||||
If you're on macOS or Linux and have [tea][tea] installed, getting
|
If you're on macOS or Linux and have [tea][tea] installed, getting Task is as
|
||||||
Task is as simple as running:
|
simple as running:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
tea task
|
tea task
|
||||||
```
|
```
|
||||||
|
|
||||||
or, if you have tea’s magic enabled:
|
or, if you have tea’s magic enabled:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
task
|
task
|
||||||
```
|
```
|
||||||
|
|
||||||
This installation method is community owned. After a new release of Task, they
|
This installation method is community owned. After a new release of Task, they
|
||||||
are automatically released by tea in a minimum of time.
|
are automatically released by tea in a minimum of time.
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ are automatically released by tea in a minimum of time.
|
|||||||
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux
|
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux
|
||||||
distribution should allow classic confinement for Snaps to Task work right:
|
distribution should allow classic confinement for Snaps to Task work right:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
sudo snap install task --classic
|
sudo snap install task --classic
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ sudo snap install task --classic
|
|||||||
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as
|
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as
|
||||||
simple as running:
|
simple as running:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
choco install go-task
|
choco install go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ This installation method is community owned.
|
|||||||
If you're on Windows and have [Scoop][scoop] installed, getting Task is as
|
If you're on Windows and have [Scoop][scoop] installed, getting Task is as
|
||||||
simple as running:
|
simple as running:
|
||||||
|
|
||||||
```cmd
|
```shell
|
||||||
scoop install task
|
scoop install task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -84,7 +85,7 @@ If you're on Arch Linux you can install Task from
|
|||||||
[AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite
|
[AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite
|
||||||
package manager such as `yay`, `pacaur` or `yaourt`:
|
package manager such as `yay`, `pacaur` or `yaourt`:
|
||||||
|
|
||||||
```cmd
|
```shell
|
||||||
yay -S go-task-bin
|
yay -S go-task-bin
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,7 +94,7 @@ Alternatively, there's
|
|||||||
the source code instead of downloading the binary from the
|
the source code instead of downloading the binary from the
|
||||||
[releases page](https://github.com/go-task/task/releases):
|
[releases page](https://github.com/go-task/task/releases):
|
||||||
|
|
||||||
```cmd
|
```shell
|
||||||
yay -S go-task
|
yay -S go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ If you're on Fedora Linux you can install Task from the official
|
|||||||
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
|
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
|
||||||
repository using `dnf`:
|
repository using `dnf`:
|
||||||
|
|
||||||
```cmd
|
```shell
|
||||||
sudo dnf install go-task
|
sudo dnf install go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ take some time until it's available in
|
|||||||
If you're on NixOS or have Nix installed you can install Task from
|
If you're on NixOS or have Nix installed you can install Task from
|
||||||
[nixpkgs](https://github.com/NixOS/nixpkgs):
|
[nixpkgs](https://github.com/NixOS/nixpkgs):
|
||||||
|
|
||||||
```cmd
|
```shell
|
||||||
nix-env -iA nixpkgs.go-task
|
nix-env -iA nixpkgs.go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ take some time until it's available in
|
|||||||
You can also use Node and npm to install Task by installing
|
You can also use Node and npm to install Task by installing
|
||||||
[this package](https://www.npmjs.com/package/@go-task/cli).
|
[this package](https://www.npmjs.com/package/@go-task/cli).
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
npm install -g @go-task/cli
|
npm install -g @go-task/cli
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ If you are using Windows and installed the
|
|||||||
[winget](https://github.com/microsoft/winget-cli) package management tool, you
|
[winget](https://github.com/microsoft/winget-cli) package management tool, you
|
||||||
can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
|
can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
winget install Task.Task
|
winget install Task.Task
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -165,7 +166,7 @@ easy generation of this script.
|
|||||||
By default, it installs on the `./bin` directory relative to the working
|
By default, it installs on the `./bin` directory relative to the working
|
||||||
directory:
|
directory:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -173,7 +174,7 @@ It is possible to override the installation directory with the `-b` parameter.
|
|||||||
On Linux, common choices are `~/.local/bin` and `~/bin` to install for the
|
On Linux, common choices are `~/.local/bin` and `~/bin` to install for the
|
||||||
current user or `/usr/local/bin` to install for all users:
|
current user or `/usr/local/bin` to install for all users:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -209,13 +210,13 @@ setup. You can find the minimum required version of Go in the
|
|||||||
|
|
||||||
You can then install the latest release globally by running:
|
You can then install the latest release globally by running:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
go install github.com/go-task/task/v3/cmd/task@latest
|
go install github.com/go-task/task/v3/cmd/task@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can install into another directory:
|
Or you can install into another directory:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
|
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -239,7 +240,7 @@ First, ensure that you installed bash-completion using your package manager.
|
|||||||
|
|
||||||
Make the completion file executable:
|
Make the completion file executable:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
chmod +x path/to/task.bash
|
chmod +x path/to/task.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -278,7 +279,7 @@ mv path/to/task.fish ~/.config/fish/completions/task.fish
|
|||||||
|
|
||||||
Open your profile script with:
|
Open your profile script with:
|
||||||
|
|
||||||
```
|
```powershell
|
||||||
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
|
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
|
||||||
notepad $profile
|
notepad $profile
|
||||||
```
|
```
|
||||||
|
@ -27,7 +27,7 @@ tasks:
|
|||||||
|
|
||||||
Running the tasks is as simple as running:
|
Running the tasks is as simple as running:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
task assets build
|
task assets build
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -162,11 +162,11 @@ variables, as you can see in the [Variables](#variables) section.
|
|||||||
You can also ask Task to include `.env` like files by using the `dotenv:`
|
You can also ask Task to include `.env` like files by using the `dotenv:`
|
||||||
setting:
|
setting:
|
||||||
|
|
||||||
```bash title=".env"
|
```shell title=".env"
|
||||||
KEYNAME=VALUE
|
KEYNAME=VALUE
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash title="testing/.env"
|
```shell title="testing/.env"
|
||||||
ENDPOINT=testing.com
|
ENDPOINT=testing.com
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -699,7 +699,7 @@ path like `tmp/task` that will be interpreted as relative to the project
|
|||||||
directory, or an absolute or home path like `/tmp/.task` or `~/.task`
|
directory, or an absolute or home path like `/tmp/.task` or `~/.task`
|
||||||
(subdirectories will be created for each project).
|
(subdirectories will be created for each project).
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
export TASK_TEMP_DIR='~/.task'
|
export TASK_TEMP_DIR='~/.task'
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -950,7 +950,7 @@ listed below in order of importance (i.e. most important first):
|
|||||||
|
|
||||||
Example of sending parameters with environment variables:
|
Example of sending parameters with environment variables:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ TASK_VARIABLE=a-value task do-something
|
$ TASK_VARIABLE=a-value task do-something
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -964,7 +964,7 @@ Since some shells do not support the above syntax to set environment variables
|
|||||||
(Windows) tasks also accept a similar style when not at the beginning of the
|
(Windows) tasks also accept a similar style when not at the beginning of the
|
||||||
command.
|
command.
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!"
|
$ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!"
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1192,7 +1192,7 @@ If `--` is given in the CLI, all following parameters are added to a special
|
|||||||
|
|
||||||
The below example will run `yarn install`.
|
The below example will run `yarn install`.
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ task yarn -- install
|
$ task yarn -- install
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1400,7 +1400,7 @@ tasks:
|
|||||||
|
|
||||||
would print the following output:
|
would print the following output:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
* build: Build the go binary.
|
* build: Build the go binary.
|
||||||
* test: Run all the go tests.
|
* test: Run all the go tests.
|
||||||
```
|
```
|
||||||
@ -1533,7 +1533,7 @@ tasks:
|
|||||||
- echo 'dangerous command'
|
- echo 'dangerous command'
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
❯ task dangerous
|
❯ task dangerous
|
||||||
task: "This is a dangerous command... Do you want to continue?" [y/N]
|
task: "This is a dangerous command... Do you want to continue?" [y/N]
|
||||||
```
|
```
|
||||||
@ -1542,7 +1542,7 @@ Warning prompts are called before executing a task. If a prompt is denied Task
|
|||||||
will exit with [exit code](/api#exit-codes) 205. If approved, Task will continue
|
will exit with [exit code](/api#exit-codes) 205. If approved, Task will continue
|
||||||
as normal.
|
as normal.
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
❯ task example
|
❯ task example
|
||||||
not dangerous command
|
not dangerous command
|
||||||
task: "This is a dangerous command. Do you want to continue?" [y/N]
|
task: "This is a dangerous command. Do you want to continue?" [y/N]
|
||||||
@ -1579,14 +1579,14 @@ tasks:
|
|||||||
|
|
||||||
Normally this will be printed:
|
Normally this will be printed:
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
echo "Print something"
|
echo "Print something"
|
||||||
Print something
|
Print something
|
||||||
```
|
```
|
||||||
|
|
||||||
With silent mode on, the below will be printed instead:
|
With silent mode on, the below will be printed instead:
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
Print something
|
Print something
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1733,7 +1733,7 @@ tasks:
|
|||||||
silent: true
|
silent: true
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ task default
|
$ task default
|
||||||
::group::default
|
::group::default
|
||||||
Hello, World!
|
Hello, World!
|
||||||
@ -1758,7 +1758,7 @@ tasks:
|
|||||||
errors: echo 'output-of-errors' && exit 1
|
errors: echo 'output-of-errors' && exit 1
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ task passes
|
$ task passes
|
||||||
$ task errors
|
$ task errors
|
||||||
output-of-errors
|
output-of-errors
|
||||||
@ -1791,7 +1791,7 @@ tasks:
|
|||||||
silent: true
|
silent: true
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
$ task default
|
$ task default
|
||||||
[print-foo] foo
|
[print-foo] foo
|
||||||
[print-bar] bar
|
[print-bar] bar
|
||||||
|
@ -254,7 +254,12 @@ const config: Config = {
|
|||||||
},
|
},
|
||||||
prism: {
|
prism: {
|
||||||
theme: lightCodeTheme,
|
theme: lightCodeTheme,
|
||||||
darkTheme: darkCodeTheme
|
darkTheme: darkCodeTheme,
|
||||||
|
additionalLanguages: [
|
||||||
|
"bash", // aka. shell
|
||||||
|
"json",
|
||||||
|
"powershell"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
// NOTE(@andreynering): Don't worry, these keys are meant to be public =)
|
// NOTE(@andreynering): Don't worry, these keys are meant to be public =)
|
||||||
algolia: {
|
algolia: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user