Created
July 3, 2010 12:05
-
-
Save mkhl/462528 to your computer and use it in GitHub Desktop.
Register Homebrew-installed DocBook on Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bail out if anything goes wrong | |
set -e | |
# Make sure Homebrew and DocBook are present | |
which -s brew | |
docbook="$(brew --prefix docbook)" | |
test -d "$docbook" | |
# Make sure the XML catalog is present | |
test -d /etc/xml || mkdir /etc/xml | |
test -f /etc/xml/catalog || xmlcatalog --noout --create /etc/xml/catalog | |
# Register DocBook in the global XML catalog | |
for catalog in "$docbook"/docbook/{xml,xsl}/*/catalog.xml; do | |
xmlcatalog --noout --del "file://$catalog" /etc/xml/catalog | |
xmlcatalog --noout --add "nextCatalog" "" "file://$catalog" /etc/xml/catalog | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment