|
#!/bin/bash |
|
|
|
echo "Brackets Contributor Setup" |
|
echo "" |
|
echo "Contributors should fork the brackets and brackets-shell" |
|
echo "repositories to their own GitHub account. Skip this step" |
|
echo "to use the main repositories." |
|
echo "" |
|
|
|
# prompt for GitHub user name |
|
echo -n "(Optional) Enter your GitHub user name and press [ENTER]: " |
|
read username |
|
|
|
brackets_shell_adobe_url="https://github.com/adobe/brackets-shell.git" |
|
brackets_adobe_url="https://github.com/adobe/brackets.git" |
|
|
|
# default to adobe repositories |
|
if [ -z "$username" ]; then |
|
brackets_shell_url="$brackets_shell_adobe_url" |
|
brackets_url="$brackets_adobe_url" |
|
else |
|
brackets_shell_url="https://github.com/${username}/brackets-shell.git" |
|
brackets_url="https://github.com/${username}/brackets.git" |
|
fi |
|
|
|
# test repository URLs |
|
wget -q $brackets_shell_url |
|
if [ $? -ne 0 ]; then |
|
echo "brackets-shell repository not found:" $brackets_shell_url |
|
echo "Fork the repository at https://github.com/adobe/brackets-shell/fork" |
|
exit 1 |
|
fi |
|
|
|
wget -q $brackets_url |
|
if [ $? -ne 0 ]; then |
|
echo "brackets repository not found:" $brackets_shell_url |
|
echo "Fork the repository at https://github.com/adobe/brackets/fork" |
|
exit 1 |
|
fi |
|
|
|
# install git |
|
sudo apt-get install --assume-yes git |
|
|
|
# clone brackets-shell |
|
git clone $brackets_shell_url |
|
|
|
# run setup |
|
pushd brackets-shell |
|
|
|
# add upstream |
|
git remote add upstream $brackets_shell_adobe_url |
|
git fetch upstream |
|
|
|
# run first time setup |
|
git checkout upstream/master |
|
./scripts/setup_linux_build.sh |
|
make |
|
popd |
|
|
|
# clone brackets |
|
git clone $brackets_url |
|
|
|
pushd brackets |
|
|
|
# add upstream |
|
git remote add upstream $brackets_adobe_url |
|
git fetch upstream |
|
|
|
# update submodules |
|
git checkout upstream/master |
|
git submodule update --init --recursive |
|
popd |
|
|
|
pushd brackets-shell |
|
# install node and grunt |
|
sudo apt-get install --assume-yes python-software-properties python g++ make |
|
sudo add-apt-repository ppa:chris-lea/node.js -y |
|
sudo apt-get update --assume-yes |
|
sudo apt-get install --assume-yes nodejs |
|
sudo npm install -g grunt-cli |
|
sudo npm install |
|
|
|
# copy files |
|
grunt copy:linux copy:www copy:samples |
|
|
|
# package www files |
|
./installer/linux/build_installer.sh |
|
|
|
# install debian package |
|
sudo dpkg -i installer/linux/brackets.deb |
|
popd |
|
|
|
# symlink git repo to installed brackets |
|
sudo ln -s "${PWD}/brackets" /usr/lib/brackets/dev |
|
|
|
echo "Done" |
|
|
|
# run brackets |
|
brackets |