Skip to content

Commit 31baa1e

Browse files
committed
Add GitHub example and clean headers
1 parent 52e0eae commit 31baa1e

File tree

9 files changed

+58
-26
lines changed

9 files changed

+58
-26
lines changed

Taskfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
set -eo pipefail
33

44
# =========================================================
5-
# Taskfile gives you a set of quick tasks for your project.
6-
# Run ./Taskfile in your CLI to see all available tasks.
7-
# More info on: https://bit.ly/taskfile-base
5+
# Taskfile gives you a set of quick tasks for your project
6+
# More info: https://bit.ly/taskfile-base
87
# =========================================================
98

109
# =========================================================

bin/task

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/usr/bin/env bash
2+
set -eo pipefail
23

34
# =========================================================
4-
# More info on Taskfile can be found here:
5-
# https://github.com/rick-nu/Taskfile
5+
# Taskfile gives you a set of quick tasks for your project
6+
# More info: https://bit.ly/taskfile-base
67
# =========================================================
78

8-
set -eo pipefail
9-
109
CURRENT_DIR=$(pwd)
1110
RED=$(printf '\033[31m')
1211
RESET=$(printf '\033[0m')

docs/base.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# The Taskfile base
2-
31
[Overview](../README.md) ➤ Taskfile base
42

3+
# The Taskfile base
4+
55
Below is the Taskfile base we recommend you use. Below we will explain what sections are in the base and why.
66

77
```bash
88
#!/bin/bash
99
set -eo pipefail
1010

1111
# =========================================================
12-
# Taskfile gives you a set of quick tasks for your project.
13-
# Run ./Taskfile in your CLI to see all available tasks.
14-
# More info on: https://bit.ly/taskfile-base
12+
# Taskfile gives you a set of quick tasks for your project
13+
# More info: https://bit.ly/taskfile-base
1514
# =========================================================
1615

1716
# TODO:
@@ -79,8 +78,8 @@ a new process.
7978

8079
```bash
8180
function task:my-new-task { ## My new task example
82-
title "Starting with my new task"
83-
# Your task continues here...
81+
title "Starting with my new task"
82+
# Your task continues here...
8483
}
8584
```
8685

@@ -99,4 +98,4 @@ your system, so you can use `task <task>` in the future. It will look for a `Tas
9998

10099
# Adding relevant tasks
101100

102-
Relevant tasks for your project can be found in [the overview](../README.md).
101+
Relevant tasks for your project can be found in [the tasks overview](./usefull-tasks.md).

docs/section/docker.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Docker
2-
31
[Overview](../../README.md)[Usefull tasks](../usefull-tasks.md) ➤ Docker
42

3+
# Docker
4+
55
An absolute must if your project is running via docker locally.
66

77
```bash
@@ -36,3 +36,7 @@ function task:logs { ## Stop the local project
3636
docker compose logs -f
3737
}
3838
```
39+
40+
## Easily jump into your container
41+
42+
To do.

docs/section/github.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
[Overview](../../README.md)[Usefull tasks](../usefull-tasks.md) ➤ GitHub
2+
13
# GitHub
24

3-
[Overview](../../README.md)[Usefull tasks](../usefull-tasks.md) ➤ GitHub
5+
If you use GitHub and want an easy way to check out Pull Requests locally,
6+
`task:pr` is a great addition to your project section in the Taskfile.
7+
8+
```bash
9+
# ===========================
10+
## Project
11+
# ===========================
12+
13+
function task:pr { ## Check out pull request <number> and update
14+
project:checkout-pr
15+
project:update
16+
}
17+
18+
function project:checkout-pr {
19+
title "Checking out pull request"
20+
if [ -z "$1" ]
21+
then
22+
echo "You need to provide a pull request number to check out."
23+
echo -e "${BLUE}Usage:${RESET} $0 pr ${YELLOW}<number>${RESET}"
24+
exit 422
25+
fi
26+
echo "Checking out pull request $1..."
27+
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1
28+
git checkout origin/pr/$1
29+
}
30+
```

docs/section/gitlab.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# GitLab
2-
31
[Overview](../../README.md)[Usefull tasks](../usefull-tasks.md) ➤ GitLab
42

3+
# GitLab
4+
55
If you use GitLab and want an easy way to check out Merge Requests locally,
66
`task:mr` is a great addition to your project section in the Taskfile.
77

88
```bash
9+
# ===========================
10+
## Project
11+
# ===========================
12+
913
function task:mr { ## Check out merge request <number> and update
1014
project:checkout-mr
1115
project:update

docs/section/project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Project section
2-
31
[Overview](../../README.md)[Usefull tasks](../usefull-tasks.md) ➤ Project
42

3+
# Project section
4+
55
A project section can be very usefull to quickly get your project up and running,
66
including the latest changes. A common practice is to include a `task:init` to get your
77
entire project up and running with a single command, and a `task:update` to make sure everything

docs/usefull-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Usefull tasks
2-
31
[Overview](../README.md) ➤ Usefull tasks
42

3+
# Usefull tasks
4+
55
We strongly recommend that your project uses a project section containing a `init` and a `update` task. Check out our
66
example:
77

docs/what-is-a-taskfile.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# What is a taskfile?!
2-
31
[Overview](../README.md) ➤ What is a Taskfile
42

3+
# What is a taskfile?!
4+
55
TODO.

0 commit comments

Comments
 (0)