2016-10-05 11:21:19 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-23 06:11:20 +01:00
|
|
|
set -e
|
|
|
|
|
2016-10-05 11:21:19 +08:00
|
|
|
# run command at repo root
|
|
|
|
CURRENT_PATH=$PWD
|
2016-10-14 19:28:54 +08:00
|
|
|
if [ -d .git ]; then
|
2017-10-10 13:36:37 +02:00
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
2016-10-14 19:28:54 +08:00
|
|
|
fi
|
2016-10-05 11:21:19 +08:00
|
|
|
|
|
|
|
if ! type npm > /dev/null
|
|
|
|
then
|
2016-10-05 14:09:39 +08:00
|
|
|
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
|
2016-10-05 11:21:19 +08:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "copy config files"
|
2016-10-05 12:12:21 +08:00
|
|
|
if [ ! -f config.json ]; then
|
|
|
|
cp config.json.example config.json
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f .sequelizerc ]; then
|
|
|
|
cp .sequelizerc.example .sequelizerc
|
|
|
|
fi
|
2016-10-05 11:21:19 +08:00
|
|
|
|
2016-12-11 10:31:51 +08:00
|
|
|
echo "install npm packages"
|
|
|
|
BUILD_ASSETS=false npm install
|
2016-10-05 11:21:19 +08:00
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
|
2018-06-22 21:07:30 +02:00
|
|
|
Edit the following config file to setup CodiMD server and client.
|
|
|
|
Read more info at https://github.com/hackmdio/codimd#configuration-files
|
2016-10-05 11:21:19 +08:00
|
|
|
|
2018-06-22 21:07:30 +02:00
|
|
|
* config.json -- CodiMD config
|
2016-10-05 12:07:07 +08:00
|
|
|
* .sequelizerc -- db config
|
2016-10-05 11:21:19 +08:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# change directory back
|
2017-10-10 13:36:37 +02:00
|
|
|
cd "$CURRENT_PATH"
|