Created
February 19, 2013 08:11
-
-
Save nacho4d/4983932 to your computer and use it in GitHub Desktop.
Install *.docset files
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/sh | |
# | |
# Description: | |
# Installs the given *.docset so it is visible by Xcode, Dash, etc | |
# | |
# Usage: | |
# installDocumentation path/to/documentation.docset | |
# | |
# Check parameters | |
if [ "$#" -eq 1 ]; then | |
if [[ -d "$1" ]]; then | |
DOCSET_INPUT_PATH=$1 | |
if [[ ${DOCSET_INPUT_PATH##*.} -ne "docset" ]]; then | |
echo "Error : Documentation file must be a *.docset file" | |
exit 1 | |
fi | |
else | |
echo "Error : No documentation was found at \"$1\"" | |
exit 1 | |
fi | |
else | |
echo "Error: Miss-usage. This script needs the path to a *.docset file" | |
exit 1 | |
fi | |
# Prepare the installation directory | |
DOCSET_OUTPUT_PATH=$HOME/Library/Developer/Shared/Documentation/DocSets/ | |
mkdir -p $DOCSET_OUTPUT_PATH | |
# Move (Install) documentation | |
mv $DOCSET_INPUT_PATH $DOCSET_OUTPUT_PATH | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment