Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 73325dc

Browse files
committed
fixes
1 parent f0f9d59 commit 73325dc

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

deno.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "@nyaomidev/amdfriend",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"exports": "./src/cli.ts",
55
"tasks": {
66
"test": "deno run --watch --allow-read --allow-write --allow-run src/cli.ts",
7-
"start": "deno run --allow-read --allow-write --allow-run src/cli.ts"
7+
"start": "deno run --allow-read --allow-write --allow-run src/cli.ts",
8+
"compile": "deno compile --allow-read --allow-write --allow-run --output amdfriend-deno --include src/worker.ts src/cli.ts"
89
},
910
"imports": {
1011
"yargs": "https://deno.land/x/yargs/deno.ts",

src/worker.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,16 @@ export async function patchFile(filePath: string, options: PatchOptions): Promis
4343
let buffer: Uint8Array<ArrayBufferLike>;
4444
try {
4545
buffer = await Deno.readFile(filePath);
46-
} catch (_) {
47-
console.log(`${filePath} is a directory. Skipping...`);
46+
// deno-lint-ignore no-explicit-any
47+
} catch (e: any) {
48+
switch(e.code){
49+
case "ENOENT":
50+
console.log(`Cannot read ${filePath} as it was not found.`);
51+
break;
52+
default:
53+
console.log(`Cannot read ${filePath}. Skipping...`);
54+
break;
55+
}
4856
return null;
4957
}
5058

0 commit comments

Comments
 (0)