Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions tools/restore_installed_build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
#!/bin/sh
#!/bin/bash

# Detect the user's operating system
platform=`uname -s`;
if [[ "$platform" == 'Linux' ]]; then
# This is the default directory for Ubuntu installations (if installed with the *.deb).
# May have to adjust if other operating systems use different directories.
default_app_directory='/opt/brackets';
symlink='dev';
elif [[ "$platform" == 'Darwin' ]]; then # MAC OSX
default_app_directory='/Applications/Brackets Sprint 14.app';
symlink='Contents/dev';
else
# Warn for unknown operating system?
default_app_directory='/opt/brackets';
symlink='dev';
fi

# Make sure the appname was passed in and is valid
if [[ ${1} == "" ]]; then
echo "Usage: restore_installed_build.sh <application>"
echo "Restore Brackets to use the installed HTML/CSS/JS files."
echo ""
echo "Parameters: application - full path to the Brackets application"
echo "Example: ./restore_installed_build.sh \"/Applications/Brackets Sprint 14.app\""
exit;
echo "Example: ./setup_for_hacking.sh \"$default_app_directory\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change setup_for_hacking to restore_installed_build

exit 0;
fi

if [ ! -d "${1}" ]; then
echo "$1 not found."
exit;
exit 1;
fi

if [[ -d "${1}/Contents/dev" || -n $(find -L "${1}/Contents/dev" -type l) ]]; then
rm "${1}/Contents/dev"
link_name="${1}/$symlink"

if [[ -L "$link_name" ]]; then
rm "$link_name" || exit 1;
echo "$1 has been restored to the installed configuration."
fi
34 changes: 26 additions & 8 deletions tools/setup_for_hacking.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
#!/bin/sh
#!/bin/bash

# Detect the user's operating system
platform=`uname -s`;
if [[ "$platform" == 'Linux' ]]; then
# This is the default directory for Ubuntu installations (if installed with the *.deb).
# May have to adjust if other operating systems use different directories.
default_app_directory='/opt/brackets';
symlink='dev';
elif [[ "$platform" == 'Darwin' ]]; then # MAC OSX
default_app_directory='/Applications/Brackets Sprint 14.app';
symlink='Contents/dev';
else
# Warn for unknown operating system?
default_app_directory='/opt/brackets';
symlink='dev';
fi

# Make sure the appname was passed in and is valid
if [[ ${1} == "" ]]; then
echo "Usage: setup_for_hacking.sh <application>"
echo "Setup Brackets to use the HTML/CSS/JS files pulled from GitHub."
echo ""
echo "Parameters: application - full path to the Brackets application"
echo "Example: ./setup_for_hacking.sh \"/Applications/Brackets Sprint 14.app\""
exit;
echo "Example: ./setup_for_hacking.sh \"$default_app_directory\""
exit 0;
fi

if [ ! -d "${1}" ]; then
echo "$1 not found."
exit;
exit 1;
fi

# Get the full path of this script
Expand All @@ -25,13 +41,15 @@ fi;
# Remove /tools/setup_for_hacking.sh to get the root directory
root_dir=${full_path%/*/*}

# Remove existing "dev" symlink, if present
if [[ -d "${1}/Contents/dev" || -n $(find -L "${1}/Contents/dev" -type l) ]]; then
rm "${1}/Contents/dev"
link_name="${1}/$symlink"

# Remove existing symlink, if present
if [[ -L "$link_name" ]]; then
rm "$link_name" || exit 1;
fi

# Make new symlink
ln -s "$root_dir" "${1}/Contents/dev"
ln -s "$root_dir" "$link_name" || exit 1;

echo "Brackets will now use the files in $root_dir"
echo "Run the restore_installed_build.sh script to revert back to the installed source files"
10 changes: 5 additions & 5 deletions tools/setup_server_smokes.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Make sure the server root folder was passed in and is valid
if [[ ${1} == "" ]]; then
Expand All @@ -7,12 +7,12 @@ if [[ ${1} == "" ]]; then
echo ""
echo "Parameters: server-root-path - local file path to server root folder"
echo "Example: ./setup_server_smokes.sh \"/Library/WebServer/Documents\""
exit;
exit 0;
fi

if [ ! -d "${1}" ]; then
echo "$1 not found."
exit;
exit 1;
fi

# Get the full path of this script
Expand All @@ -30,10 +30,10 @@ server_test_dir="$root_dir/test/smokes/server-tests"

# Remove existing "server-tests" symlink, if present
if [ -d "${1}/server-tests" ]; then
rm "${1}/server-tests"
rm "${1}/server-tests" || exit 1;
fi

# Make new symlink
ln -s "$server_test_dir" "${1}/server-tests"
ln -s "$server_test_dir" "${1}/server-tests" || exit 1;

echo "Local server now has access to Brackets server-tests smoke test files"