summaryrefslogtreecommitdiff
path: root/rules/CC/foreign/EXPRESSIONS
blob: 2cc1ac978c43f70de1af1e9b1b532ce64bb5cf74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ "strip-prefix":
  { "doc":
    [ "Returns list of artifact maps (each map contains a single artifact)"
    , "with the given prefix being stripped from their path."
    ]
  , "vars": ["artifacts", "paths", "prefix"]
  , "vars_doc":
    { "artifacts": ["A single map containing all artifacts."]
    , "paths": ["List of (unprefixed) artifacts paths to consider."]
    , "prefix": ["Prefix to strip from the artifact's path."]
    }
  , "expression":
    { "type": "foreach"
    , "var": "path"
    , "range": {"type": "var", "name": "paths"}
    , "body":
      { "type": "singleton_map"
      , "key": {"type": "var", "name": "path"}
      , "value":
        { "type": "lookup"
        , "key":
          { "type": "join"
          , "separator": "/"
          , "$1":
            [ {"type": "var", "name": "prefix"}
            , {"type": "var", "name": "path"}
            ]
          }
        , "map": {"type": "var", "name": "artifacts"}
        }
      }
    }
  }
}