Skip to content

Commit

Permalink
Improve style
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed May 24, 2020
1 parent ba8d6b0 commit 7c90f34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ $ swiftbox -v
$ swiftbox check 5.2.4
[global] Swift 5.2.4 is kept locally and set to default.
$ swiftbox check 5.1
Swift 5.1 is available for Ubuntu 18.04, you can get it with: swiftbox get 5.1
Swift 5.1 is available for Ubuntu 18.04
You can get it with: swiftbox get 5.1
$ swiftbox check nightly
Swift nightly build 2020-05-11-a is available for Amazon Linux 2, you can get it with: swiftbox get nightly
Swift nightly build 2020-05-11-a is available for Amazon Linux 2
You can get it with: swiftbox get nightly
$ swiftbox check 2.1
Swift 2.1 does not exist or does not support your CentOS Linux version.
```
Expand Down Expand Up @@ -180,7 +182,7 @@ Users of versions under 0.12 should do a fresh installation for the upgrade.
You can use one of the following ways:

```console
$ swiftbox upgrade
$ swiftbox update
swiftbox 0.9 is already installed in /usr/bin
Input 'yes' or 'y' to upgrade, anything else to do a fresh installation: n
```
Expand Down
20 changes: 13 additions & 7 deletions swiftbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Set environment properties

SWIFTBOX_VERSION="0.12"
SWIFTBOX_VERSION="0.12.1"

if [ `id -u` = 0 ]
then
Expand Down Expand Up @@ -316,15 +316,17 @@ select-version() {
ensure-env
echo "$SCHEME Now using Swift $1"
else
echo "$SCHEME Swift $1 has not been kept, you can get it with: $PROGRAM get $1"
echo "$SCHEME Swift $1 has not been kept."
echo "You can get it with: $PROGRAM get $1"
return 20
fi
}

remove-swift() {
if [ ! -d $WORKING_DIR/toolchain/swift-$1 ]
then
echo "$SCHEME Swift $1 has not been kept, you can get it with: $PROGRAM get $1"
echo "$SCHEME Swift $1 has not been kept."
echo "You can get it with: $PROGRAM get $1"
return 4
else
rm -rf $WORKING_DIR/toolchain/swift-$1
Expand Down Expand Up @@ -361,7 +363,8 @@ check)
echo "$SCHEME Swift $2 is kept locally and already set to default."
elif [ `is-kept $2` ]
then
echo "$SCHEME Swift $2 is kept locally, you can enable it with: $PROGRAM use $2"
echo "$SCHEME Swift $2 is kept locally."
echo "You can enable it with: $PROGRAM use $2"
else
if [ E$2 = "Enightly" ]
then
Expand All @@ -377,15 +380,17 @@ check)
fi
if [ E$2 = "Enightly" ]
then
echo "Swift nightly build $NEW_VERSION is available for $SYSTEM_NICENAME $SYSTEM_VERSION, you can get it with: $PROGRAM get nightly"
echo "Swift nightly build $NEW_VERSION is available for $SYSTEM_NICENAME $SYSTEM_VERSION"
echo "You can get it with: $PROGRAM get nightly"
else
check-version
VERSION_AVAILABILITY=$?
if [ $VERSION_AVAILABILITY != 0 ]
then
exit
fi
echo "Swift $NEW_VERSION is available for $SYSTEM_NICENAME $SYSTEM_VERSION, you can get it with: $PROGRAM get $NEW_VERSION"
echo "Swift $NEW_VERSION is available for $SYSTEM_NICENAME $SYSTEM_VERSION"
echo "You can get it with: $PROGRAM get $NEW_VERSION"
fi
fi
;;
Expand All @@ -412,7 +417,8 @@ get)
exit 34
elif [ `is-kept $NEW_VERSION` ]
then
echo "$SCHEME Swift $NEW_VERSION is kept locally, you can enable it with: $PROGRAM use $NEW_VERSION"
echo "$SCHEME Swift $NEW_VERSION is kept locally."
echo "You can enable it with: $PROGRAM use $NEW_VERSION"
exit 33
else
fetch-$TOOLCHAIN_TYPE $NEW_VERSION
Expand Down

0 comments on commit 7c90f34

Please sign in to comment.