Skip to content

Commit

Permalink
[VSCode] "Start new PWA" path separator fix for non-Windows platforms (
Browse files Browse the repository at this point in the history
…#4656)

Currently, the "Start new PWA" flow results in the following error on
macOS, because PWABuilder tries to create a path using Windows backslash
separators.

```A system error occurred (ENOENT: no such file or directory, rename '/REDACTED\decompressedTemplate\pwa-starter-main' -> '/REDACTED\REDACTED')```

## PR Type
Bugfix

Co-authored-by: Justin Willis <jgw9617@gmail.com>
  • Loading branch information
joellimberg and jgw96 committed Feb 20, 2024
1 parent 49649d5 commit 4fedd08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/pwabuilder-vscode/src/services/new-pwa-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ export function isNpmInstalled(): boolean {
async function fetchFromGithub(): Promise<string> {
const streamPipeline = promisify(pipeline);

const fetchedZipPath: string = `${repositoryParentURI?.fsPath}\\fetchedTemplate.zip`;
const decompressedZipPath: string = `${repositoryParentURI?.fsPath}\\decompressedTemplate`;
const decompressedRepoPath: string = `${decompressedZipPath}\\pwa-starter-main`;
const finalLocationPath: string = `${repositoryParentURI?.fsPath}\\${repositoryName}`;
const fetchedZipPath: string = `${repositoryParentURI?.fsPath}/fetchedTemplate.zip`;
const decompressedZipPath: string = `${repositoryParentURI?.fsPath}/decompressedTemplate`;
const decompressedRepoPath: string = `${decompressedZipPath}/pwa-starter-main`;
const finalLocationPath: string = `${repositoryParentURI?.fsPath}/${repositoryName}`;

const res = await fetch(starterRepositoryURI);
if(res.body) {
Expand All @@ -164,4 +164,4 @@ function inputCancelledWarning(): void {

export function noNpmInstalledWarning(): void {
vscode.window.showWarningMessage(noNpmWarning);
}
}

0 comments on commit 4fedd08

Please sign in to comment.