41 lines
1018 B
Bash
Executable File
41 lines
1018 B
Bash
Executable File
#! /bin/env bash
|
|
|
|
CONTENT="${CONTENT:-content}"
|
|
SITE_ENV="${SITE_ENV:-${CONTENT}/site-env}"
|
|
|
|
curate="${curate:-about}"
|
|
index="${index:-index}"
|
|
|
|
mkdir -p ${CONTENT}
|
|
|
|
# Confirm overwrite of configuration
|
|
if [[ -r ${SITE_ENV} ]]
|
|
then
|
|
read -N 1 -p "Overwrite configuration in ${SITE_ENV} Y/N [Y]? " overwrite
|
|
if [[ "${overwrite}" = "y" ]] # TODO accept upper of lower y
|
|
then
|
|
rm -f ${SITE_ENV}
|
|
fi
|
|
fi
|
|
|
|
echo "List directories of curated content that will NOT be automatically indexed: "
|
|
echo "(default: ${curate})"
|
|
read -p "> " curate
|
|
echo "CURATE_DIRS=${curate}" >> ${SITE_ENV}
|
|
|
|
echo "List directories of curated content that WILL be automatically indexed: "
|
|
echo "(default: ${index})"
|
|
read -p "> " index
|
|
echo "INDEX_DIRS=${index}" >> ${SITE_ENV}
|
|
|
|
echo "Enter URL for content:"
|
|
read -p "> " content_url
|
|
echo "GEMINI_SITE=${content_url}" >> ${SITE_ENV}
|
|
|
|
echo "Enter URL of the Gemini site:"
|
|
read -p "> " gemini_url
|
|
echo "GEMINI_URL=${gemini_url}" >> ${SITE_ENV}
|
|
|
|
echo "\nCreated ${SITE_ENV}:\n"
|
|
cat "${SITE_ENV}"
|