Skip to content

Commit

Permalink
Merge pull request #157 from kuettler/install_argument
Browse files Browse the repository at this point in the history
Add "install" argument to update script
  • Loading branch information
andralex committed Jan 28, 2015
2 parents caf93fc + 444f801 commit b4c3322
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions update.sh
Expand Up @@ -47,8 +47,12 @@ function handleCmdLine() {
(--tag=*)
tag="`echo $arg | sed 's/[-a-zA-Z0-9]*=//'`"
;;
(install)
install="yes"
;;
(*)
echo "Error: $arg not recognized." >&2exit 1
echo "Error: $arg not recognized." >&2
exit 1
;;
esac
done
Expand Down Expand Up @@ -170,11 +174,13 @@ function makeWorld() {
)

# Update the running dmd version
local old=$(which dmd)
if [ -f "$old" ]; then
echo "Copying "$wd/dmd/src/dmd" over $old"
[ ! -w "$old" ] && local sudo="sudo"
$sudo cp "$wd/dmd/src/dmd" "$old"
if [[ ! -z $install ]]; then
local old=$(which dmd)
if [ -f "$old" ]; then
echo "Copying "$wd/dmd/src/dmd" over $old"
[ ! -w "$old" ] && local sudo="sudo"
$sudo cp "$wd/dmd/src/dmd" "$old"
fi
fi

# Then make druntime
Expand All @@ -198,7 +204,7 @@ function makeWorld() {
}

# main
handleCmdLine
handleCmdLine $*
confirmChoices
installAnew $toInstall
update $toUpdate
Expand Down

0 comments on commit b4c3322

Please sign in to comment.