summaryrefslogtreecommitdiff
path: root/subdir.myr
blob: 0efd958fcd2a03be46f1feda23ef32d6a502efe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std

use "types.use"
use "util.use"

pkg bld =
	const subdirs	: (p : build#, subs : byte[:][:], targ : std.option(byte[:]) -> void)
;;

const subdirs = {p, subs, targ
	for s in subs
		std.put("Entering directory '%s'\n", s)
		if !std.chdir(s)
			std.fatal(1, "unable to enter directory %s\n", s)
		;;
		run(p.cmd)
		std.put("Leaving directory '%s'\n", s)
		if !std.chdir("..")
			std.fatal(1, "unable to leave directory %s\n", s)
		;;
	;;
}