This repository was archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Fix shell tools for Linux #4810
Merged
jasonsanjose
merged 6 commits into
adobe:master
from
IQAndreas:fix-shell-tools-for-linux
Aug 21, 2013
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
46114c9
Change from Shell scripts to Bash scripts
IQAndreas 7a929f8
Change the example based on current operating system
IQAndreas d3fa7eb
Change target symlink depending on OS
IQAndreas dab1cfe
Use proper exit codes in shell scripts
IQAndreas fafb023
Simplify checking for existing symlink
IQAndreas 50cd459
Correct "Example code"
IQAndreas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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\"" | ||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change
setup_for_hackingtorestore_installed_build