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:
foxyzandClaude Opus 5.5 committed 2026-10-09 23:53:52 +03:00
1 parent 059b7dd306
commit 2d39018a73
27 files changed
+382 -171

No files matched your search

+13 -1
View File
@@ -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;
}
+25 -1
View File
@@ -17,6 +17,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.3.0"
archive:
dependency: transitive
description:
name: archive
sha256: "6c5bcd986e06b94e3c40244af471750840a3d2341d1f9763a1100a14add517b4"
url: "https://pub.dev"
source: hosted
version: "4.3.0"
args:
dependency: "direct main"
description:
@@ -81,6 +89,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.7"
ffi:
dependency: transitive
description:
name: ffi
sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
file:
dependency: transitive
description:
@@ -201,6 +217,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.3"
posix:
dependency: transitive
description:
name: posix
sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e
url: "https://pub.dev"
source: hosted
version: "6.5.2"
pub_semver:
dependency: transitive
description:
@@ -319,7 +343,7 @@ packages:
path: "../core"
relative: true
source: path
version: "0.1.0"
version: "1.0.1"
term_glyph:
dependency: transitive
description: