One updater for app and server: updater in core; watch-together-server --upgrade / --check-update; update.sh uses the server
The server's version is stamped like the app's (APP_VERSION) when packaged, so it can compare against the manifest; --upgrade swaps the whole install folder (app and server) and asks for a restart. update.sh/.bat no longer need GTK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
059b7dd306
commit
2d39018a73
27 files changed
+382
-171
No files matched your search
@@ -30,6 +30,11 @@ Future<void> main(List<String> args) async {
|
||||
help: 'cookies.txt or browser-extension JSON export to log that yt-dlp in (sites that refuse guests). '
|
||||
'An account login: keep it private. Copied into --yt-dlp-dir at start.')
|
||||
..addOption('config', help: 'YAML or JSON config file (keys as in AppConfig); overrides the other flags.')
|
||||
..addFlag('upgrade',
|
||||
negatable: false,
|
||||
help: 'Update this install (the whole folder, app included) to the latest release, then exit. '
|
||||
'Restart the server afterwards to run it.')
|
||||
..addFlag('check-update', negatable: false, help: 'Print whether a newer release exists, then exit.')
|
||||
..addFlag('help', abbr: 'h', negatable: false, help: 'Show this help.');
|
||||
final ArgResults parsed;
|
||||
try {
|
||||
@@ -41,7 +46,14 @@ Future<void> main(List<String> args) async {
|
||||
}
|
||||
if (parsed['help'] as bool) {
|
||||
// ignore: avoid_print
|
||||
print('watch-together-server (proto ${RelayConstants.protoVersion})\n\n${parser.usage}');
|
||||
print('watch-together-server $appVersion (proto ${RelayConstants.protoVersion})\n\n${parser.usage}');
|
||||
return;
|
||||
}
|
||||
if (parsed['upgrade'] as bool || parsed['check-update'] as bool) {
|
||||
exitCode = await runUpgrade(
|
||||
program: 'watch-together-server',
|
||||
checkOnly: !(parsed['upgrade'] as bool),
|
||||
restartNote: (v) => 'updated to $v — restart the server to run $v.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user