Skip to content

Commit a15496a

Browse files
committed
Added the current keyword, documented it, and bumped the version
1 parent 1ca4a89 commit a15496a

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 2.1.0
4+
5+
Features Added:
6+
7+
- Added a new keyword, `current`, which will automatically select the current version/build to install
8+
9+
Bug Fixes:
10+
11+
- Removed some junk debugging messages that would appear even if we are quieted.
12+
13+
other Fixes:
14+
15+
- Added section to the readme that describes how to use keywords.
16+
17+
318
## 2.0.0
419

520
Major changes!
@@ -9,7 +24,7 @@ This update mostly focuses on behind the scene bug
924
fixes and improvements,
1025
but we do have some new features to offer.
1126

12-
Features Added:
27+
Features Added:
1328

1429
- Added the ability to check the integrity of the file using the SHA256 hash provided by the PaperMC API
1530
- Implemented a very basic caching system to reduce the number of calls made to the PaperMC API

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,30 @@ Copies the old file to a new location before the installation process:
180180
Displays stats on the selected version and build:
181181
>-s, --stats
182182
183+
## Special Keywords
184+
185+
The `-v`, `-b`, and interactive menu have special keywords
186+
that can be used to do special things.
187+
188+
The `latest` keyword will automatically select the latest option available.
189+
190+
The `current` keyword will automatically select the currently installed currently installed value.
191+
192+
For example, lets say you have paper version 1.17 and build 60 installed.
193+
If you want to get the latest build while maintaining your installed version,
194+
then you can run server update like so:
195+
196+
>python server_update.py -v current [PATH]
197+
198+
This will only install new builds for your current version.
199+
You can also use the `current` keyword to ensure that the version
200+
will never change, regardless of what you have installed.
201+
202+
These keywords can be used in the interactive menu as well.
203+
You can also use these keywords for selecting the build,
204+
although using the `current` keyword for build selection is not recommended!
205+
206+
183207
## Deprecated Command Line Options
184208

185209
The following command line options are deprecated. They are still included for backwards compatibility,
@@ -314,6 +338,9 @@ Great if you want to set up a new server install.
314338
Copy the old file to a new location before the installation process:
315339
>python server_update.py --copy-old /new/spot/old.jar [PATH]
316340
341+
Select the currently installed version as the version to install:
342+
>python server_update.py -v current [PATH]
343+
317344
# Notes on Deprecated Features
318345

319346
In earlier versions of PaperMC-Update, the script would keep a config file in the users home directory

server_update.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
A Set of tools to automate the server update process.
3232
"""
3333

34-
__version__ = '2.0.0'
34+
__version__ = '2.1.0'
3535

3636

3737
def load_config(config: str) -> Tuple[str, int]:
@@ -1447,7 +1447,7 @@ def _select(self, val: Any, choice: Sequence[Any], default: str, name: str, prin
14471447
"""
14481448
Selects a value from the choices.
14491449
We support updater keywords,
1450-
like 'latest' and ''.
1450+
like 'latest', 'current' and ''.
14511451
14521452
:param val: Value entered
14531453
:type val: Any
@@ -1481,6 +1481,12 @@ def _select(self, val: Any, choice: Sequence[Any], default: str, name: str, prin
14811481

14821482
return val
14831483

1484+
if val == 'current':
1485+
1486+
# User wants currently installed version:
1487+
1488+
val = self.version
1489+
14841490
if val not in choice:
14851491

14861492
# User selected invalid option

0 commit comments

Comments
 (0)