feat(tools/magrathea): let users override the repository root
for global installations of magrathea, setting MG_ROOT can be a way to switch quickly between different repositories (esp. in combination with `cd (mg path)`). Change-Id: I4627fe78b7cc112b75ab57e7806ffd85c6d38aee Reviewed-on: https://cl.tvl.fyi/c/depot/+/4396 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com>
This commit is contained in:
parent
46a4e25550
commit
8fb90b9e5e
1 changed files with 4 additions and 3 deletions
|
@ -168,9 +168,10 @@ USAGE
|
|||
(or mg--repository-root
|
||||
(begin
|
||||
(set! mg--repository-root
|
||||
(or (get-environment-variable "MG_ROOT")
|
||||
(string-chomp
|
||||
(call-with-input-pipe "git rev-parse --show-toplevel"
|
||||
(lambda (p) (read-string #f p)))))
|
||||
(lambda (p) (read-string #f p))))))
|
||||
mg--repository-root)))
|
||||
|
||||
;; determine the current path relative to the root of the repository
|
||||
|
|
Loading…
Reference in a new issue