Skip to content

Commit 7ffa822

Browse files
committed
Rename APIs
1 parent bd8f7bc commit 7ffa822

File tree

4 files changed

+57
-57
lines changed

4 files changed

+57
-57
lines changed

.github/workflows/CI.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- name: Test swiftbox install
2424
run: ./swiftbox.sh install
2525

26-
- name: Test swiftbox lookup
27-
run: swiftbox lookup $MAINVER
26+
- name: Test swiftbox check
27+
run: swiftbox check $MAINVER
2828

2929
- name: Test swiftbox get with sudo
3030
run: |
@@ -61,10 +61,10 @@ jobs:
6161
fi
6262
swiftc -v
6363
64-
- name: Test swiftbox clean
64+
- name: Test swiftbox cleanup
6565
run: |
66-
swiftbox clean
67-
sudo swiftbox clean
66+
swiftbox cleanup
67+
sudo swiftbox cleanup
6868
6969
- name: Test swiftbox remove
7070
run: |
@@ -131,8 +131,8 @@ jobs:
131131
- name: Test swiftbox install
132132
run: ./swiftbox.sh install
133133

134-
- name: Test swiftbox lookup
135-
run: swiftbox lookup $MAINVER
134+
- name: Test swiftbox check
135+
run: swiftbox check $MAINVER
136136

137137
- name: Install which
138138
run: sudo yum install which -y
@@ -162,10 +162,10 @@ jobs:
162162
swiftbox list
163163
sudo swiftbox list
164164
165-
- name: Test swiftbox clean
165+
- name: Test swiftbox cleanup
166166
run: |
167-
swiftbox clean
168-
sudo swiftbox clean
167+
swiftbox cleanup
168+
sudo swiftbox cleanup
169169
170170
- name: Test swiftbox remove
171171
run: sudo swiftbox remove $MAINVER
@@ -233,8 +233,8 @@ jobs:
233233
- name: Test swiftbox install
234234
run: ./swiftbox.sh install
235235

236-
- name: Test swiftbox lookup
237-
run: swiftbox lookup $MAINVER
236+
- name: Test swiftbox check
237+
run: swiftbox check $MAINVER
238238

239239
- name: Install which
240240
run: sudo yum install which -y
@@ -264,10 +264,10 @@ jobs:
264264
swiftbox list
265265
sudo swiftbox list
266266
267-
- name: Test swiftbox clean
267+
- name: Test swiftbox cleanup
268268
run: |
269-
swiftbox clean
270-
sudo swiftbox clean
269+
swiftbox cleanup
270+
sudo swiftbox cleanup
271271
272272
- name: Test swiftbox remove
273273
run: sudo swiftbox remove $MAINVER
@@ -312,8 +312,8 @@ jobs:
312312
chmod +x swiftbox.sh
313313
./swiftbox.sh -v
314314
315-
- name: Test swiftbox lookup nightly
316-
run: ./swiftbox.sh lookup nightly
315+
- name: Test swiftbox check nightly
316+
run: ./swiftbox.sh check nightly
317317

318318
- name: Test swiftbox get nightly
319319
env:
@@ -349,8 +349,8 @@ jobs:
349349
chmod +x swiftbox.sh
350350
./swiftbox.sh -v
351351
352-
- name: Test swiftbox lookup nightly
353-
run: ./swiftbox.sh lookup nightly
352+
- name: Test swiftbox check nightly
353+
run: ./swiftbox.sh check nightly
354354

355355
- name: Test swiftbox get nightly
356356
run: ./swiftbox.sh get nightly
@@ -389,8 +389,8 @@ jobs:
389389
chmod +x swiftbox.sh
390390
./swiftbox.sh -v
391391
392-
- name: Test swiftbox lookup nightly
393-
run: ./swiftbox.sh lookup nightly
392+
- name: Test swiftbox check nightly
393+
run: ./swiftbox.sh check nightly
394394

395395
- name: Test swiftbox get nightly
396396
run: ./swiftbox.sh get nightly

.github/workflows/Tag.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656
apt-get update
5757
apt-get install sudo curl -y
5858
59-
- name: Test swiftbox install and update
59+
- name: Test swiftbox install and upgrade
6060
run: |
6161
sh -c "$(curl -fsSL https://raw.githubusercontent.com/stevapple/swiftbox/master/install.sh)"
6262
swiftbox -v
63-
sudo swiftbox update
63+
sudo swiftbox upgrade
6464
6565
- name: Test swiftbox setup
6666
env:
@@ -79,11 +79,11 @@ jobs:
7979
- name: Install sudo
8080
run: yum install sudo -y
8181

82-
- name: Test swiftbox install and update
82+
- name: Test swiftbox install and upgrade
8383
run: |
8484
sh -c "$(curl -fsSL https://raw.githubusercontent.com/stevapple/swiftbox/master/install.sh)"
8585
swiftbox -v
86-
sudo swiftbox update
86+
sudo swiftbox upgrade
8787
8888
- name: Test swiftbox setup
8989
run: |
@@ -99,11 +99,11 @@ jobs:
9999
- name: Install sudo
100100
run: yum install sudo -y
101101

102-
- name: Test swiftbox install and update
102+
- name: Test swiftbox install and upgrade
103103
run: |
104104
sh -c "$(curl -fsSL https://raw.githubusercontent.com/stevapple/swiftbox/master/install.sh)"
105105
swiftbox -v
106-
sudo swiftbox update
106+
sudo swiftbox upgrade
107107
108108
- name: Test swiftbox setup
109109
run: |

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ chmod +x install.sh
2121
./install.sh
2222
```
2323

24-
Or if you'd like to use it as a script (doesn't support `update` yet):
24+
Or if you'd like to use it as a script (doesn't support `upgrade` yet):
2525

2626
```bash
2727
# With wget
@@ -77,23 +77,23 @@ You may notice a `[user]` or `[global]` prefix in the output, which indicates th
7777

7878
```console
7979
$ swiftbox -v
80-
0.9
80+
0.11
8181
```
8282

8383
### Check the availability of Swift versions
8484

8585
```console
86-
$ swiftbox lookup 5.2.4
86+
$ swiftbox check 5.2.4
8787
[global] Swift 5.2.4 is kept locally and set to default.
88-
$ swiftbox lookup 5.1
88+
$ swiftbox check 5.1
8989
Swift 5.1 is available for Ubuntu 18.04, you can get it with: swiftbox get 5.1
90-
$ swiftbox lookup nightly
90+
$ swiftbox check nightly
9191
Swift nightly build 2020-05-11-a is available for Amazon Linux 2, you can get it with: swiftbox get nightly
92-
$ swiftbox lookup 2.1
92+
$ swiftbox check 2.1
9393
Swift 2.1 does not exist or does not support your CentOS Linux version.
9494
```
9595

96-
### Manage Swift versions
96+
### Manage Swift toolchains
9797

9898
Both release builds and the latest nightly build are available.
9999

@@ -103,7 +103,7 @@ $ swiftbox get nightly
103103
$ swiftbox remove 5.0
104104
```
105105

106-
### Switch to a Swift version
106+
### Select a Swift version
107107

108108
```console
109109
$ swiftbox use 5.2.2
@@ -117,7 +117,7 @@ $ sudo swiftbox close
117117
[global] Swift 5.2.2 is now disabled.
118118
```
119119

120-
### Lookup installed Swift versions
120+
### List local toolchain versions
121121

122122
The active one is marked with `*`.
123123

@@ -131,15 +131,15 @@ $ swiftbox list
131131
### Clear download cache
132132

133133
```console
134-
$ swiftbox clean
134+
$ swiftbox cleanup
135135
[user] Successfully cleaned the cache.
136136
```
137137

138-
### Update `swiftbox`
138+
### Upgrade `swiftbox`
139139

140-
Update to the latest version if `swiftbox` is installed in `/usr/bin`.
140+
Upgrade to the latest version if `swiftbox` is installed in `/usr/bin`.
141141

142142
```console
143-
$ swiftbox update
144-
Successfully upgraded swiftbox from 0.9 to 0.10.6
143+
$ swiftbox upgrade
144+
Successfully upgraded swiftbox from 0.9 to 0.11
145145
```

swiftbox.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Set environment properties
44

5-
SWIFTBOX_VERSION="0.10.8"
5+
SWIFTBOX_VERSION="0.11"
66

77
if [ `id -u` = 0 ]
88
then
@@ -227,7 +227,7 @@ nightly-version() {
227227

228228
## Install Swift toolchains
229229

230-
get-release() {
230+
fetch-release() {
231231
cd $WORKING_DIR
232232
FILE_NAME="swift-$NEW_VERSION-RELEASE-$SYSTEM_NAME$SYSTEM_VERSION"
233233
DOWNLOAD_URL="https://swift.org/builds/swift-$NEW_VERSION-release/$SYSTEM_NAME${SYSTEM_VERSION//./}/swift-$NEW_VERSION-RELEASE/$FILE_NAME.tar.gz"
@@ -240,7 +240,7 @@ get-release() {
240240
install-toolchain
241241
}
242242

243-
get-snapshot() {
243+
fetch-snapshot() {
244244
cd $WORKING_DIR
245245
FILE_NAME="swift-DEVELOPMENT-SNAPSHOT-$NEW_VERSION-$SYSTEM_NAME$SYSTEM_VERSION"
246246
DOWNLOAD_URL="https://swift.org/builds/development/$SYSTEM_NAME${SYSTEM_VERSION//./}/swift-DEVELOPMENT-SNAPSHOT-$NEW_VERSION/$FILE_NAME.tar.gz"
@@ -272,7 +272,7 @@ install-toolchain() {
272272
if [ $? != 0 ]
273273
then
274274
echo "Signature check failed, please try again."
275-
echo "If it always fails, clear the cache with: $0 clean"
275+
echo "If it always fails, clear the cache with: $0 cleanup"
276276
exit 100
277277
fi
278278
tar -xzf download/$FILE_NAME.tar.gz -C temp
@@ -299,15 +299,15 @@ default-version() {
299299
fi
300300
}
301301

302-
use-version() {
302+
select-version() {
303303
is-kept $1
304304
if [ $? = 0 ]
305305
then
306306
echo $1 > $WORKING_DIR/.swift-version
307307
ensure-env
308308
echo "$SCHEME Now using Swift $1"
309309
else
310-
echo "$SCHEME Swift $1 has not been installed yet."
310+
echo "$SCHEME Swift $1 has not been kept, you can get it with: $0 get $1"
311311
return 20
312312
fi
313313
}
@@ -346,7 +346,7 @@ then
346346
fi
347347

348348
case $1 in
349-
lookup)
349+
check)
350350
if [ E$2 = E`default-version` ]
351351
then
352352
echo "$SCHEME Swift $2 is kept locally and set to default."
@@ -406,17 +406,17 @@ get)
406406
echo "$SCHEME Swift $NEW_VERSION is kept locally, you can enable it with: $0 use $NEW_VERSION"
407407
exit 33
408408
else
409-
get-$TOOLCHAIN_TYPE $NEW_VERSION
410-
GET_RESULT=$?
411-
if [ $GET_RESULT != 0 ]
409+
fetch-$TOOLCHAIN_TYPE $NEW_VERSION
410+
FETCH_RESULT=$?
411+
if [ $FETCH_RESULT != 0 ]
412412
then
413-
exit $GET_RESULT
413+
exit $FETCH_RESULT
414414
fi
415415
echo "$SCHEME Swift $NEW_VERSION is ready for use!"
416416
if [ ! -f .swift-version ]
417417
then
418418
echo "$SCHEME Automatically set Swift $NEW_VERSION as default."
419-
use-version $NEW_VERSION
419+
select-version $NEW_VERSION
420420
fi
421421
fi
422422
;;
@@ -436,7 +436,7 @@ list)
436436
done
437437
;;
438438
use)
439-
use-version $2
439+
select-version $2
440440
exit $?
441441
;;
442442
remove)
@@ -448,16 +448,16 @@ close)
448448
disable-swift
449449
exit $?
450450
;;
451-
clean)
451+
cleanup)
452452
ensure-env
453453
rm -rf $WORKING_DIR/temp/*
454454
rm -rf $WORKING_DIR/download/*
455455
echo "$SCHEME Successfully cleaned the cache."
456456
;;
457-
update)
457+
upgrade)
458458
if [ $(realpath `dirname $0`) != $INSTALL_DIR ]
459459
then
460-
echo "swiftbox is not installed to system, update is unavailable."
460+
echo "swiftbox is not installed to system, upgrade is unavailable."
461461
echo "You can install it with: $0 install"
462462
exit 254
463463
fi

0 commit comments

Comments
 (0)