From 4761ed763da3595408f66e26718822473dffe26b Mon Sep 17 00:00:00 2001 From: fourside Date: Fri, 14 Jan 2022 00:02:27 +0900 Subject: [PATCH] fs.move cause error in docker https://github.com/denoland/deno/issues/3092#issuecomment-710868488 --- radiko/import_map.json | 2 +- radiko/src/recorder.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/radiko/import_map.json b/radiko/import_map.json index f3ddc93..05560c2 100644 --- a/radiko/import_map.json +++ b/radiko/import_map.json @@ -5,7 +5,7 @@ "std/encoding/base64": "https://deno.land/std@0.119.0/encoding/base64.ts", "std/datetime": "https://deno.land/std@0.119.0/datetime/mod.ts", "std/fmt/printf": "https://deno.land/std@0.119.0/fmt/printf.ts", - "std/fs": "https://deno.land/std@0.119.0/fs/mod.ts", + "std/fs/copy": "https://deno.land/std@0.119.0/fs/copy.ts", "x/aws_api/client": "https://deno.land/x/aws_api@v0.5.0/client/mod.ts", "x/aws_api/sqs": "https://deno.land/x/aws_api@v0.5.0/services/sqs/mod.ts", "x/zod": "https://deno.land/x/zod@v3.11.6/mod.ts", diff --git a/radiko/src/recorder.ts b/radiko/src/recorder.ts index 94a8550..bb16ac8 100644 --- a/radiko/src/recorder.ts +++ b/radiko/src/recorder.ts @@ -1,6 +1,6 @@ import { formatTimeForFfmpeg } from "./date.ts"; import { RecRadikoError } from "./rec-radiko-error.ts"; -import { moveSync } from "std/fs"; +import { copySync } from "std/fs/copy"; export type RecordMeta = { station: string; @@ -110,5 +110,6 @@ async function runPipedProcess(cmd: string[]): Promise< } function moveFile(filePath: string, targetPath: string): void { - moveSync(filePath, targetPath); + copySync(filePath, targetPath); + Deno.removeSync(filePath); }