#!/bin/bash -ex # Pull most recent Let's Chat sources. root_dir=$(dirname "$0")/.. sources_dir=$root_dir/sources rm -rf $sources_dir/lets-chat rm -rf $sources_dir/lets-chat-ldap git clone git@github.com:sdelements/lets-chat.git $sources_dir/lets-chat git clone git@github.com:sdelements/lets-chat-ldap.git $sources_dir/lets-chat-ldap # Pre-install node modules cd $sources_dir/lets-chat npm cache clear npm install --production npm install --production lets-chat-ldap # Stage changes # (git forbids to add a `.git` directory in a subdirectory (except when using submodules); remove them) cd $root_dir rm -rf $sources_dir/lets-chat/.git rm -rf $sources_dir/lets-chat-ldap/.git git add $sources_dir/* git add -f $sources_dir/lets-chat/node_modules/ echo "Let's Chat sources pulled. Now commit the changes."