From 3090f61713c7360b12d5ae710686376b0c5e6f82 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 18 Dec 2021 20:27:37 +0100 Subject: fix(tools/magrathea): prevent trailing slash for // in path All targets would have no trailing slash, so it was at least ugly that // had one as the only legal target. Change-Id: I1b60850ac86d8c550f262841694fb00c518413b8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4404 Autosubmit: sterni Tested-by: BuildkiteCI Reviewed-by: tazjin --- tools/magrathea/mg.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/magrathea/mg.scm b/tools/magrathea/mg.scm index 990fb87f90..e5b0cb07d4 100644 --- a/tools/magrathea/mg.scm +++ b/tools/magrathea/mg.scm @@ -246,12 +246,13 @@ USAGE (define (path args) (match args [(arg) - (print (conc (repository-root) - "/" - (string-intersperse - (target-components - (normalise-target - (guarantee-success (parse-target arg)))) "/")))] + (print (apply string-append + (intersperse + (cons (repository-root) + (target-components + (normalise-target + (guarantee-success (parse-target arg))))) + "/")))] [() (mg-error "path command needs a target")] [other (mg-error (format "unknown arguments: ~a" other))])) -- cgit 1.4.1