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