Skip to content

Commit 74c86fe

Browse files
committed
Update taskfile with project commands for development
1 parent 381472a commit 74c86fe

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

Taskfile

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,39 @@ set -eo pipefail
99
PATH=./node_modules/.bin:$PATH
1010

1111
# =========================================================
12-
## Documentation
12+
## Project
1313
# =========================================================
1414

15-
function task:docs { ## Build the documentation files
16-
title "Building documentation"
17-
echo "Creating html pages from markdown..."
18-
sleep 3
19-
echo "Documentation built in dist/ folder."
15+
function task:init { ## Set up the project for local development
16+
task:update
17+
task:help
18+
}
19+
20+
function task:update { ## Update all project dependencies
21+
project:install-dependencies
22+
}
23+
24+
function task:pr { ## Check out pull request <number> and update
25+
project:checkout-pr $1
26+
task:update
27+
}
28+
29+
function project:checkout-pr {
30+
title "Checking out pull request"
31+
if [ -z "$1" ]
32+
then
33+
echo "You need to provide a pull request number to check out."
34+
echo -e "${BLUE}Usage:${RESET} $0 pr ${YELLOW}<number>${RESET}"
35+
exit 422
36+
fi
37+
echo "Checking out pull request $1..."
38+
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1
39+
git checkout origin/pr/$1
40+
}
41+
42+
function project:install-dependencies {
43+
title "Installing dependencies"
44+
npm install
2045
}
2146

2247
# =========================================================

0 commit comments

Comments
 (0)