Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
crystal-dash-docset/build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
24 lines (17 sloc)
559 Bytes
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 | |
set -x | |
set -e | |
# Build the docset | |
dashing build | |
# Path to docset db index | |
DB=Crystal.docset/Contents/Resources/docSet.dsidx | |
# Fix newlines | |
newlined=$(echo "SELECT id FROM searchIndex WHERE name LIKE '% | |
%';" | sqlite3 $DB) | |
for id in $newlined; do | |
name=$(echo "SELECT name FROM searchIndex WHERE id = ${id};" | sqlite3 $DB) | |
newname=$(echo $name | awk '{ print $1 }') | |
echo "UPDATE searchIndex SET name = '${newname}' WHERE id = ${id};" | sqlite3 $DB | |
done | |
# Compress docset | |
tar --exclude='.DS_Store' -cvzf Crystal.tgz Crystal.docset |