mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
Add level template
This commit is contained in:
parent
4eeab48346
commit
a457afdadb
1 changed files with 31 additions and 0 deletions
31
levels/contrib/template
Normal file
31
levels/contrib/template
Normal file
|
@ -0,0 +1,31 @@
|
|||
[description]
|
||||
|
||||
This text will be shown when the level starts.
|
||||
|
||||
It describes the task or puzzle the player can solve.
|
||||
|
||||
[congrats]
|
||||
|
||||
This text will be shown after the player has solved the level.
|
||||
|
||||
Can contain additional information, or bonus exercises.
|
||||
|
||||
[setup]
|
||||
|
||||
# Bash commands that set up the initial state of the level. An initial
|
||||
# `git init` is always done automatically. The default branch is called `main`.
|
||||
|
||||
echo You > people_who_are_awesome
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
[win]
|
||||
|
||||
# Bash commands that check whether the level is solved. Write these as if you're
|
||||
# writing the body of a Bash function. Make the function return 0 if it's
|
||||
# solved, and a non-zero value otherwise. You can use `return`, and also, Bash
|
||||
# functions return the exit code of the last statement, which sometimes allows
|
||||
# very succinct checks.
|
||||
|
||||
# Check whether the file has at least two lines in the latest commit:
|
||||
test "$(git show HEAD:people_who_are_awesome | wc -l)" -ge 2
|
Loading…
Reference in a new issue