Skip to content

Commit 0601296

Browse files
committed
1. Added support for reading versioning info from config files located in custom locations(not in /[PATH TO SERVER JAR]/version_history.json)
2. Fixed some output issues 3. Added quiet mode, where only error information and interactive questions are outputted to the terminal. 4. Made the README file more readable, and added a changelog section. 5. Ignored some more files in .gitignore, PyInstaller stuff.
1 parent 7626644 commit 0601296

File tree

3 files changed

+159
-91
lines changed

3 files changed

+159
-91
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ venv.bak/
1919
__pycache__/
2020
*.py[cod]
2121
*$py.class
22+
23+
# Pyinstaller Files
24+
build/
25+
dist/
26+
*.spec

README.md

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,22 @@ it will be installed to this path under the same name.
4343

4444
This command will do the following:
4545

46-
1. Attempt to load current paper version/build(`/PATH_TO_SERVER_JAR/version_history.json`. This script only supports official builds of the paper server, meaning that we may fail to read config information for un-official builds). If no configuration data is found, and version info is not supplied via the command line, then the version and build for the currently installed server will default to 0.
47-
2. Check for a new version/build using the [PaperMC download API](https://paper.readthedocs.io/en/latest/site/api.html#downloads-api).
48-
3. If a new version/build is available, the default version and build(usually the latest) will be installed. Alternatively, the user can be prompted to manually select which version/build they want to be installed. You can use the `--interactive` flag for this.
49-
4. The selected version is downloaded to a temporary directory located somewhere on your computer(This directory is generated using the python tempfile module, meaning that it will be generated in a safe, unobtrusive manner, and will be automatically removed at termination of the script).
46+
1. Attempt to load current paper version/build(`/PATH_TO_SERVER_JAR/version_history.json`, or elsewhere if specified.
47+
This script only supports official builds of the paper server, meaning that we may fail to read config
48+
information for un-official builds). If no configuration data is found, and version info is not supplied via the
49+
command line, then the version and build for the currently installed server will default to 0.
50+
2. Check for a new version/build using the
51+
[PaperMC download API](https://paper.readthedocs.io/en/latest/site/api.html#downloads-api).
52+
3. If a new version/build is available, the default version and build(usually the latest) will be installed.
53+
Alternatively, the user can be prompted to manually select which version/build they want to be installed. You can use
54+
the `--interactive` flag for this.
55+
4. The selected version is downloaded to a temporary directory located somewhere on your computer
56+
(This directory is generated using the python tempfile module, meaning that it will be generated in a safe,
57+
unobtrusive manner, and will be automatically removed at termination of the script).
5058
5. The currently installed version of the server is backed up to the temporary directory, and deleted.
51-
6. The newly downloaded server is moved from the temporary directory to the path of the old server, and will retain the name of the old server(If an error occurs for any reason during the instillation procedure, then the script will attempt to recover your backed up version of the old server from the temporary directory).
59+
6. The newly downloaded server is moved from the temporary directory to the path of the old server,
60+
and will retain the name of the old server(If an error occurs for any reason during the instillation procedure,
61+
then the script will attempt to recover your backed up version of the old server from the temporary directory).
5262

5363
This is the default operation of this script. However, you can fine tune the update process using the command line options
5464
listed below.
@@ -80,6 +90,13 @@ Prompts the user for the version they would like to install:
8090
Will not load configuration data:
8191
>-nlc, --no-load-config
8292
93+
Sets config file path(`/PATH_TO_SERVER_JAR/version_history.json` by default):
94+
95+
>-cf, --config-file [PATH TO CONFIG FILE]
96+
97+
Will only output errors and interactive questions to the terminal:
98+
>-q, --quiet
99+
83100
## Deprecated Command Line Options
84101

85102
The following command line options are deprecated. They are still included for backwards compatibility,
@@ -118,6 +135,7 @@ Check to see if a newer version is available, does not install:
118135

119136
In earlier versions of PaperMC-Update, the script would keep a config file in the users home directory
120137
(Or elsewhere if specified) containing version information on the server so it can be persistent across runs.
138+
121139
There were many problems with this: it created unnecessary files, it was inaccurate,
122140
and it made using PaperMC-Update a lot more complicated. Now, we read version info from a file named
123141
'version_history.json', which is kept in the root directory of the server, and is managed by the server itself. This
@@ -167,14 +185,38 @@ so be warned.
167185

168186
# Conclusion
169187

170-
This script provides a simple method to check/download/install PaperMC server updates. You can add your command to the beginning of your start file, to ensure that you are always running the latest server version.
171-
If you are hosting a server for a friend/customer, you can use this script to manage the updating process for them, so they don't have to.
188+
This script provides a simple method to check/download/install PaperMC server updates. You can add your command to the
189+
beginning of your start file, to ensure that you are always running the latest server version.
190+
If you are hosting a server for a friend/customer, you can use this script to manage the updating process for them,
191+
so they don't have to.
192+
193+
# Changelog
194+
195+
## 1.1.0
196+
197+
- Added command line option '-q' for quiet output
198+
- Fixed typos/output issues
199+
- Can read config files in custom locations
200+
201+
## 1.0.0
202+
203+
- Initial version
204+
- Added support for reading configuration info directly from the paper versioning file
205+
- Removed old command line options
206+
- Fixed some issues with selecting version
172207

173208
# Special Thanks
174209

175210
[devStorm](https://github.com/developStorm) - Helped with configuration file management, and offered valuable insight
176211
into the paper versioning file.
177212

213+
# Pull Requests
214+
215+
Pull requests are welcome and encouraged!
216+
217+
If you have any bug fixes or changes, feel free to open a pull request.
218+
Any changes/fixes are greatly appreciated!
219+
178220
# Issues/Bugs
179221

180222
If you have any questions on usage, or you have found a bug, please open a github issue. I would be happy to help!
@@ -184,6 +226,6 @@ If you are reporting a bug/error, be sure to include the following:
184226
1. Description of what you were doing
185227
2. All arguments used
186228
3. Version/build you are trying to install
187-
4. Version/build of the currently installed server(If you know it).
229+
4. Version/build of the currently installed server(If you know it)
188230
5. Fail point(If provided, should be for most cases)
189231
6. Stack trace/error name(If provided, should be for most cases)

0 commit comments

Comments
 (0)