mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-06 19:57:26 -08:00
make pretty
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { hasExplicitCommand, parseArgs, shouldRunSettingsOnlyStartup, shouldStartApp } from './args';
|
||||
import {
|
||||
hasExplicitCommand,
|
||||
parseArgs,
|
||||
shouldRunSettingsOnlyStartup,
|
||||
shouldStartApp,
|
||||
} from './args';
|
||||
|
||||
test('parseArgs parses booleans and value flags', () => {
|
||||
const args = parseArgs([
|
||||
@@ -148,10 +153,7 @@ test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
|
||||
'/tmp/subminer-jf-response.json',
|
||||
]);
|
||||
assert.equal(jellyfinPreviewAuth.jellyfinPreviewAuth, true);
|
||||
assert.equal(
|
||||
jellyfinPreviewAuth.jellyfinResponsePath,
|
||||
'/tmp/subminer-jf-response.json',
|
||||
);
|
||||
assert.equal(jellyfinPreviewAuth.jellyfinResponsePath, '/tmp/subminer-jf-response.json');
|
||||
assert.equal(hasExplicitCommand(jellyfinPreviewAuth), true);
|
||||
assert.equal(shouldStartApp(jellyfinPreviewAuth), false);
|
||||
|
||||
|
||||
@@ -240,7 +240,9 @@ export function parseArgs(argv: string[]): CliArgs {
|
||||
if (value === 'true' || value === '1' || value === 'yes') args.jellyfinRecursive = true;
|
||||
if (value === 'false' || value === '0' || value === 'no') args.jellyfinRecursive = false;
|
||||
} else if (arg === '--jellyfin-recursive') {
|
||||
const value = readValue(argv[i + 1])?.trim().toLowerCase();
|
||||
const value = readValue(argv[i + 1])
|
||||
?.trim()
|
||||
.toLowerCase();
|
||||
if (value === 'false' || value === '0' || value === 'no') {
|
||||
args.jellyfinRecursive = false;
|
||||
} else if (value === 'true' || value === '1' || value === 'yes') {
|
||||
|
||||
Reference in New Issue
Block a user