Skip to content

Commit 228ed95

Browse files
Fix path separator.
1 parent c67ac37 commit 228ed95

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

generator/juce-templates.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ export function generateVSDetector(): string {
470470
* Supports Visual Studio 2019, 2022, and 2026.
471471
*/
472472
473+
import { join } from "jsr:@std/path@1.0.8";
474+
473475
export interface VSVersion {
474476
year: string;
475477
version: string;
@@ -509,8 +511,8 @@ export async function detectInstalledVSVersions(): Promise<VSVersion[]> {
509511
try {
510512
// Common Visual Studio installation base paths
511513
const basePaths = [
512-
"C:\\\\Program Files\\\\Microsoft Visual Studio",
513-
"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio",
514+
join("C:", "Program Files", "Microsoft Visual Studio"),
515+
join("C:", "Program Files (x86)", "Microsoft Visual Studio"),
514516
];
515517
516518
// Check each supported version
@@ -520,13 +522,13 @@ export async function detectInstalledVSVersions(): Promise<VSVersion[]> {
520522
const editions = ["Community", "Professional", "Enterprise"];
521523
522524
for (const edition of editions) {
523-
const fullPath = \\\`\\\${basePath}\\\\\\\\\\\${vsVersion.year}\\\\\\\\\\\${edition}\\\`;
525+
const fullPath = join(basePath, vsVersion.year, edition);
524526
525527
try {
526528
const stat = await Deno.stat(fullPath);
527529
if (stat.isDirectory) {
528530
// Check if VC tools are installed
529-
const vcToolsPath = \\\`\\\${fullPath}\\\\\\\\VC\\\\\\\\Tools\\\\\\\\MSVC\\\`;
531+
const vcToolsPath = join(fullPath, "VC", "Tools", "MSVC");
530532
try {
531533
await Deno.stat(vcToolsPath);
532534
installedVersions.push({

generator/vs-detector.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Supports Visual Studio 2019, 2022, and 2026.
66
*/
77

8+
import { join } from "jsr:@std/path@1.0.8";
9+
810
export interface VSVersion {
911
year: string;
1012
version: string;
@@ -44,8 +46,8 @@ export async function detectInstalledVSVersions(): Promise<VSVersion[]> {
4446
try {
4547
// Common Visual Studio installation base paths
4648
const basePaths = [
47-
"C:\\Program Files\\Microsoft Visual Studio",
48-
"C:\\Program Files (x86)\\Microsoft Visual Studio",
49+
join("C:", "Program Files", "Microsoft Visual Studio"),
50+
join("C:", "Program Files (x86)", "Microsoft Visual Studio"),
4951
];
5052

5153
// Check each supported version
@@ -55,13 +57,13 @@ export async function detectInstalledVSVersions(): Promise<VSVersion[]> {
5557
const editions = ["Community", "Professional", "Enterprise"];
5658

5759
for (const edition of editions) {
58-
const fullPath = `${basePath}\\${vsVersion.year}\\${edition}`;
60+
const fullPath = join(basePath, vsVersion.year, edition);
5961

6062
try {
6163
const stat = await Deno.stat(fullPath);
6264
if (stat.isDirectory) {
6365
// Check if VC tools are installed
64-
const vcToolsPath = `${fullPath}\\VC\\Tools\\MSVC`;
66+
const vcToolsPath = join(fullPath, "VC", "Tools", "MSVC");
6567
try {
6668
await Deno.stat(vcToolsPath);
6769
installedVersions.push({

0 commit comments

Comments
 (0)