mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-15 08:12:53 -07:00
feat: add auto update support
This commit is contained in:
@@ -51,6 +51,24 @@ test('parseArgs ignores missing value after --log-level', () => {
|
||||
assert.equal(args.start, true);
|
||||
});
|
||||
|
||||
test('parseArgs captures update command and internal launcher paths', () => {
|
||||
const args = parseArgs([
|
||||
'--update',
|
||||
'--update-launcher-path',
|
||||
'/home/kyle/.local/bin/subminer',
|
||||
'--update-response-path',
|
||||
'/tmp/subminer-update-response.json',
|
||||
]);
|
||||
|
||||
assert.equal(args.update, true);
|
||||
assert.equal(args.updateLauncherPath, '/home/kyle/.local/bin/subminer');
|
||||
assert.equal(args.updateResponsePath, '/tmp/subminer-update-response.json');
|
||||
assert.equal(hasExplicitCommand(args), true);
|
||||
assert.equal(shouldStartApp(args), true);
|
||||
assert.equal(commandNeedsOverlayRuntime(args), false);
|
||||
assert.equal(shouldRunSettingsOnlyStartup(args), false);
|
||||
});
|
||||
|
||||
test('parseArgs captures launch-mpv targets and keeps it out of app startup', () => {
|
||||
const args = parseArgs(['--launch-mpv', 'C:\\a.mkv', 'C:\\b.mkv']);
|
||||
assert.equal(args.launchMpv, true);
|
||||
@@ -182,6 +200,12 @@ test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
|
||||
assert.equal(shouldStartApp(refreshKnownWords), true);
|
||||
assert.equal(isHeadlessInitialCommand(refreshKnownWords), true);
|
||||
|
||||
const update = parseArgs(['--update']);
|
||||
assert.equal(update.update, true);
|
||||
assert.equal(hasExplicitCommand(update), true);
|
||||
assert.equal(shouldStartApp(update), true);
|
||||
assert.equal(isHeadlessInitialCommand(update), true);
|
||||
|
||||
const settings = parseArgs(['--settings']);
|
||||
assert.equal(settings.settings, true);
|
||||
assert.equal(hasExplicitCommand(settings), true);
|
||||
|
||||
Reference in New Issue
Block a user