Skip to content

Commit

Permalink
Fix issue with open in vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
AlemTuzlak committed Sep 18, 2024
1 parent cd53418 commit fb85ed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "remix-development-tools",
"description": "Remix development tools - a set of tools for developing/debugging Remix.run apps",
"author": "Alem Tuzlak",
"version": "4.5.1",
"version": "4.5.2",
"license": "MIT",
"keywords": [
"remix",
Expand Down
7 changes: 5 additions & 2 deletions src/vite/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export const remixDevTools: (args?:RemixViteConfig) => Plugin[] = (args) => {

if (!server.config.isProduction) {
const { exec } = await import("node:child_process");
const openInVsCode = (path: string, lineNum: string) => {
const openInVsCode = (path: string | undefined, lineNum: string) => {
if(!path){
return;
}
exec(`code -g "${normalizePath(path)}${lineNum}"`);
}

Expand Down Expand Up @@ -140,7 +143,7 @@ export const remixDevTools: (args?:RemixViteConfig) => Plugin[] = (args) => {
routeFile && openInVsCode(path.join(remixDir, routeID, routeFile), lineNum);
return;
}
return openInVsCode(path.join(validPath), lineNum);
return openInVsCode(validPath, lineNum);
}
});
}
Expand Down

0 comments on commit fb85ed0

Please sign in to comment.