mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 02:25:01 +00:00
48 lines
960 B
Bash
Executable file
48 lines
960 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# 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 publis/js/config.js ]; then
|
|
cp public/js/config.js.example public/js/config.js
|
|
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 hackmd server and client.
|
|
Read more info at https://github.com/hackmdio/hackmd#configuration-files
|
|
|
|
* config.json -- server config
|
|
* public/js/config.js -- client config
|
|
* .sequelizerc -- db config
|
|
|
|
EOF
|
|
|
|
# change directory back
|
|
cd $CURRENT_PATH
|