Skip to content

Commit d015df4

Browse files
committed
fix: add dedicated CLI entry point
1 parent 5a7c3ce commit d015df4

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

bin/cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import('../build/index.js');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"main": "build/index.js",
77
"bin": {
8-
"pageindex-mcp": "build/index.js"
8+
"pageindex-mcp": "bin/cli.js"
99
},
1010
"scripts": {
1111
"build": "tsup",

src/tools/process-document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ async function downloadPdf(url: string): Promise<FileInfo> {
205205
console.log(
206206
`Initial request failed for arxiv URL: ${url}, retrying with .pdf suffix`,
207207
);
208-
const retryUrl = url.endsWith('/') ? url + 'pdf' : url + '.pdf';
208+
const retryUrl = url.endsWith('/') ? `${url}pdf` : `${url}.pdf`;
209209

210210
try {
211211
response = await fetchWithRetry(retryUrl);
@@ -247,7 +247,7 @@ async function downloadPdf(url: string): Promise<FileInfo> {
247247

248248
// Ensure filename has .pdf extension if not present
249249
if (!filename.toLowerCase().endsWith('.pdf')) {
250-
filename = filename + '.pdf';
250+
filename = `${filename}.pdf`;
251251
}
252252

253253
const contentType = response.headers.get('content-type');

0 commit comments

Comments
 (0)