From 2ae003a3aca74b7cec1be858b764b0818d3a500f Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 19 Feb 2024 16:37:17 +0100 Subject: [PATCH] Correctly normalize to forward slash the path when creating tar.gz for Connect deploys `std/archive/tar.ts` will create folders based on file paths used, but it requires using `/` and not `\` in path. This is a problem on Windows, where the path separator is `\`. This commit adds a check to normalize the path to use `/` instead of `\` when creating the tar.gz file for Connect deploys. --- src/publish/common/bundle.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/publish/common/bundle.ts b/src/publish/common/bundle.ts index 5e7cee4ffd7..c72d62c513e 100644 --- a/src/publish/common/bundle.ts +++ b/src/publish/common/bundle.ts @@ -13,6 +13,7 @@ import { Tar } from "archive/tar.ts"; import { PublishFiles } from "../provider-types.ts"; import { TempContext } from "../../core/temp-types.ts"; import { md5HashBytes } from "../../core/hash.ts"; +import { pathWithForwardSlashes } from "../../core/path.ts"; interface ManifestMetadata { appmode: string; @@ -97,7 +98,9 @@ export async function createBundle( const tarFiles = [...files.files, "manifest.json"]; for (const tarFile of tarFiles) { - await tar.append(tarFile, { filePath: join(stageDir, tarFile) }); + await tar.append(pathWithForwardSlashes(tarFile), { + filePath: join(stageDir, tarFile), + }); } // write to temp file