Page 50 - Programming the Photon Getting Started With the Internet of Things
P. 50
return
fi
echo "Creating $LIB_NAME"
# Create the directory if it doesn't exist
if [ ! -d "$LIB_NAME" ]; then
echo " ==> Creating ${LIB_NAME} directory"
mkdir $LIB_NAME
fi
# CD to the directory
cd $LIB_NAME
# Create the spark.json if it doesn't exist.
if [ ! -f "spark.json" ]; then
echo " ==> Creating spark.json file"
cat <<EOS > spark.json
{
"name": "${LIB_NAME}",
"version": "0.0.1",
"author": "Someone <email@somesite.com>",
"license": "Choose a license",
"description": "Briefly describe this library"
}
EOS
fi
# Create the README file if it doesn't exist
if test -z "$(find ./ -maxdepth 1 -iname 'README*' -print -quit)"; then
echo " ==> Creating README.md"
cat <<EOS > README.md
TODO: Describe your library and how to run the examples
EOS
fi
# Create an empty license file if none exists
if test -z "$(find ./ -maxdepth 1 -iname 'LICENSE*' -print -quit)"; the
n