mirror of
https://github.com/rawiriblundell/wiki.bash-hackers.org
synced 2024-12-25 14:10:42 +01:00
Merge pull request #5 from gabe565/generate-basedir
Generate `$basedir` from git repo root
This commit is contained in:
commit
a0de579a55
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# Ensure we have our required commands, otherwise fail early
|
# Ensure we have our required commands, otherwise fail early
|
||||||
cmd_err=0
|
cmd_err=0
|
||||||
for cmd in grep sed tr sort uniq mkdir curl jq pandoc; do
|
for cmd in grep sed tr sort uniq mkdir curl jq pandoc git; do
|
||||||
if ! command -v "${cmd}" >/dev/null 2>&1; then
|
if ! command -v "${cmd}" >/dev/null 2>&1; then
|
||||||
printf -- '%s\n' "This script requires ${cmd} but it was not found in PATH." >&2
|
printf -- '%s\n' "This script requires ${cmd} but it was not found in PATH." >&2
|
||||||
(( cmd_err++ ))
|
(( cmd_err++ ))
|
||||||
@ -18,7 +18,7 @@ done
|
|||||||
(( cmd_err > 0 )) && exit 1
|
(( cmd_err > 0 )) && exit 1
|
||||||
|
|
||||||
# Where are we playing on the local file system?
|
# Where are we playing on the local file system?
|
||||||
basedir="${HOME}/git/wiki.bash-hackers.org"
|
basedir="$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
# Prepend a string e.g.
|
# Prepend a string e.g.
|
||||||
# cmd: prepend foo bar
|
# cmd: prepend foo bar
|
||||||
|
Loading…
Reference in New Issue
Block a user