-
Notifications
You must be signed in to change notification settings - Fork 2
/
format-xml.cfg
47 lines (41 loc) · 1.38 KB
/
format-xml.cfg
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
35
36
37
38
39
40
41
42
43
44
45
46
47
[buildout]
parts += ${buildout:format-xml-parts}
format-xml-parts =
format-xml
download-format-xml
format-all-xmls
[format-xml]
recipe = zc.recipe.egg:scripts
interpreter = format-xml
dependent-scripts = false
initialization = sys.argv.insert(1, "${download-format-xml:destination}/format-xml")
eggs =
# These eggs are required by the format-xml script.
lxml
argparse
# setuptools is required so that we can use pkg_resources.
setuptools
[download-format-xml]
recipe = hexagonit.recipe.download
# Be aware that this is cached in downloads cache:
# you need to change the URL in order the get a new version.
# Therefore the git-hash is included in the URL.
url = https://raw.githubusercontent.com/4teamwork/ftw-buildouts/ed8bfb8/format-xml
download-only = true
destination = ${buildout:parts-directory}/format-xml
mode = 0755
on-update = True
[format-all-xmls]
recipe = collective.recipe.template
output = ${buildout:directory}/bin/format-all-xmls
mode = 0755
standard-find-params = ! -name definition.xml ! -name solrconfig.xml
find-params =
input = inline:
#!/usr/bin/env sh
set -euo pipefail
IFS=$'\n'
pkgdir=$(${buildout:bin-directory}/package-directory)
formatter="${buildout:bin-directory}/format-xml"
$formatter $(find $pkgdir \! -path "*/upgrades/*" -type f \( -iname \*.xml -o -iname \*.zcml \) ${:standard-find-params} ${:find-params}) "$@"
exit $?