Skip to content

Commit 3fe2e57

Browse files
committed
chore: fix --no-config command type related code
- use 'options.config' instead of 'options.noConfig'
1 parent 120ed04 commit 3fe2e57

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"fedi",
3434
"fedibird",
3535
"fedify",
36+
"fedifyrc",
3637
"fediverse",
3738
"followable",
3839
"Guppe",

packages/cli/src/lookup.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const command = new Command()
196196
"-o, --output <file>",
197197
"Specify the output file path.",
198198
)
199-
.option("--no-config [flag:boolean]", "Disable loading config file.")
199+
.option("--no-config", "Disable loading config file.")
200200
.action(async (options, ...urls: string[]) => {
201201
if (urls.length < 1) {
202202
console.error("At least one URL or actor handle must be provided.");
@@ -217,11 +217,11 @@ export const command = new Command()
217217
let server: TemporaryServer | undefined = undefined;
218218
const documentLoader = await getDocumentLoader({
219219
userAgent: options.userAgent ??
220-
getSharedOption("userAgent", options.noConfig),
220+
getSharedOption("userAgent", !options.config),
221221
});
222222
const contextLoader = await getContextLoader({
223223
userAgent: options.userAgent ??
224-
getSharedOption("userAgent", options.noConfig),
224+
getSharedOption("userAgent", !options.config),
225225
});
226226
let authLoader: DocumentLoader | undefined = undefined;
227227
if (options.authorizedFetch) {
@@ -289,7 +289,7 @@ export const command = new Command()
289289
documentLoader: authLoader ?? documentLoader,
290290
contextLoader,
291291
userAgent: options.userAgent ??
292-
getSharedOption("userAgent", options.noConfig),
292+
getSharedOption("userAgent", !options.config),
293293
});
294294
if (collection == null) {
295295
spinner.fail(`Failed to fetch object: ${colors.red(url)}.`);
@@ -353,7 +353,7 @@ export const command = new Command()
353353
documentLoader: authLoader ?? documentLoader,
354354
contextLoader,
355355
userAgent: options.userAgent ??
356-
getSharedOption("userAgent", options.noConfig),
356+
getSharedOption("userAgent", !options.config),
357357
},
358358
),
359359
);

packages/cli/src/nodeinfo.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const command = new Command()
4040
{ conflicts: ["raw"] },
4141
)
4242
.option("-u, --user-agent <string>", "The custom User-Agent header value.")
43-
.option("--no-config [flag:boolean]", "Disable loading config file.")
43+
.option("--no-config", "Disable loading config file.")
4444
.action(async (options, host: string) => {
4545
const command = Deno.args.find((arg) =>
4646
arg === "node" || arg === "nodeinfo"
@@ -60,7 +60,7 @@ export const command = new Command()
6060
const nodeInfo = await getNodeInfo(url, {
6161
parse: "none",
6262
userAgent: options.userAgent ??
63-
getSharedOption("userAgent", options.noConfig),
63+
getSharedOption("userAgent", !options.config),
6464
});
6565
if (nodeInfo === undefined) {
6666
spinner.fail("No NodeInfo document found.");
@@ -74,7 +74,7 @@ export const command = new Command()
7474
const nodeInfo = await getNodeInfo(url, {
7575
parse: options.bestEffort ? "best-effort" : "strict",
7676
userAgent: options.userAgent ??
77-
getSharedOption("userAgent", options.noConfig),
77+
getSharedOption("userAgent", !options.config),
7878
});
7979
logger.debug("NodeInfo document: {nodeInfo}", { nodeInfo });
8080
if (nodeInfo == undefined) {
@@ -94,12 +94,12 @@ export const command = new Command()
9494
try {
9595
const faviconUrl = await getFaviconUrl(
9696
url,
97-
options.userAgent ?? getSharedOption("userAgent", options.noConfig),
97+
options.userAgent ?? getSharedOption("userAgent", !options.config),
9898
);
9999
const response = await fetch(faviconUrl, {
100100
headers: {
101101
"User-Agent": options.userAgent ??
102-
getSharedOption("userAgent", options.noConfig) ??
102+
getSharedOption("userAgent", !options.config) ??
103103
getUserAgent(),
104104
},
105105
});

packages/cli/src/webfinger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const command = new Command()
2222
"Maximum number of redirections to follow.",
2323
{ default: 5 },
2424
)
25-
.option("--no-config [flag:boolean]", "Disable loading config file.")
25+
.option("--no-config", "Disable loading config file.")
2626
.action(async (options, ...resources: string[]) => {
2727
if (options.maxRedirection < 0) { // Validate maxRedirection option
2828
throw new ValidationError(
@@ -40,7 +40,7 @@ export const command = new Command()
4040
const webFinger = await lookupWebFinger(url, {
4141
...options,
4242
userAgent: options.userAgent ??
43-
getSharedOption("userAgent", options.noConfig),
43+
getSharedOption("userAgent", !options.config),
4444
}) ?? // Look up WebFinger
4545
new NotFoundError(resource).throw(); // throw NotFoundError if not found
4646

0 commit comments

Comments
 (0)