nix-helpers: 9a3c10c6184861c90adf35d6c081ad4cd0113df9
1: # Create a directory containing 'files'; the directory structure will be
2: # relative to 'base', for example:
3: #
4: # dirContaining /foo/bar [ /foo/bar/baz /foo/bar/quux/foobar ]
5: #
6: # Will produce a directory containing 'baz' and 'quux/foobar'.
7: { mergeDirs, runCommand }:
8:
9: with builtins;
10: base: files:
11: mergeDirs (map (f:
12: runCommand "dir" {
13: base = toString base;
14: file = toString base + "/${f}";
15: } ''
16: REL=$(echo "$file" | sed -e "s@$base/@@g")
17: DIR=$(dirname "$REL")
18: mkdir -p "$out/$DIR"
19: ln -s "$file" "$out/$REL"
20: '') files)
Generated by git2html.