Skip to content

Commit e6dd0ff

Browse files
committed
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.
1 parent 9c27141 commit e6dd0ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/publish/common/bundle.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Tar } from "archive/tar.ts";
1313
import { PublishFiles } from "../provider-types.ts";
1414
import { TempContext } from "../../core/temp-types.ts";
1515
import { md5HashBytes } from "../../core/hash.ts";
16+
import { pathWithForwardSlashes } from "../../core/path.ts";
1617

1718
interface ManifestMetadata {
1819
appmode: string;
@@ -97,7 +98,9 @@ export async function createBundle(
9798
const tarFiles = [...files.files, "manifest.json"];
9899

99100
for (const tarFile of tarFiles) {
100-
await tar.append(tarFile, { filePath: join(stageDir, tarFile) });
101+
await tar.append(pathWithForwardSlashes(tarFile), {
102+
filePath: join(stageDir, tarFile),
103+
});
101104
}
102105

103106
// write to temp file

0 commit comments

Comments
 (0)