Test quak login and backup-metadata --exif (closes #110)
check / check (push) Successful in 46s
check / check (push) Successful in 46s
loginCommand now takes its login function and prompts from CliContext; bin/quak.ts passes Client.login and the terminal prompts, so behaviour is unchanged. Tests cover a login from QUAK_EMAIL/QUAK_PASSWORD with no prompt, the TOTP prompt, a failed login, and the saved session's modes, and show that --exif and --all each turn on EXIF extraction. Also rewraps the header comment of src/cli-commands.ts. Model: opus-5-5
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { stdout, stderr } from "node:process";
|
||||
import { input, password } from "@inquirer/prompts";
|
||||
import { Command } from "commander";
|
||||
import envPaths from "env-paths";
|
||||
import { init } from "../src/crypto/index.js";
|
||||
@@ -20,6 +21,7 @@ import {
|
||||
} from "../src/cli-commands.js";
|
||||
import { run as runCommand } from "../src/cli-run.js";
|
||||
import { loadSession } from "../src/cli-session.js";
|
||||
import { Client } from "../src/client.js";
|
||||
import { VERSION } from "../src/index.js";
|
||||
|
||||
const paths = envPaths("quak", { suffix: "" });
|
||||
@@ -42,6 +44,9 @@ const context = (): CliContext => ({
|
||||
sessionDir: paths.data,
|
||||
cacheDir: program.opts<{ cacheDir?: string }>().cacheDir,
|
||||
loadSession,
|
||||
login: (opts) => Client.login(opts),
|
||||
prompt: (message) => input({ message }),
|
||||
promptSecret: (message) => password({ message, mask: true }),
|
||||
});
|
||||
|
||||
const run = (command: Promise<number>): Promise<void> =>
|
||||
|
||||
Reference in New Issue
Block a user