hedgedoc/bin/setup
Sheogorath 4b060c7dba
Rebrand HackMD to CodiMD
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24 13:24:12 +02:00

45 lines
836 B
Bash
Executable file

#!/bin/bash
set -e
# run command at repo root
CURRENT_PATH=$PWD
if [ -d .git ]; then
cd "$(git rev-parse --show-toplevel)"
fi
if ! type npm > /dev/null
then
cat << EOF
npm is not installed, please install Node.js and npm.
Read more on Node.js official website: https://nodejs.org
Setup will not be run
EOF
exit 0
fi
echo "copy config files"
if [ ! -f config.json ]; then
cp config.json.example config.json
fi
if [ ! -f .sequelizerc ]; then
cp .sequelizerc.example .sequelizerc
fi
echo "install npm packages"
BUILD_ASSETS=false npm install
cat << EOF
Edit the following config file to setup CodiMD server and client.
Read more info at https://github.com/hackmdio/codimd#configuration-files
* config.json -- CodiMD config
* .sequelizerc -- db config
EOF
# change directory back
cd "$CURRENT_PATH"