Skip to content

Commit 1f26dcc

Browse files
committed
Fix #44, Replace project location placeholders with platform dependent hints
Signed-off-by: paulober <[email protected]>
1 parent 188e027 commit 1f26dcc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/webview/newProjectPanel.mts

+8-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import VersionBundlesLoader, {
5050
type VersionBundle,
5151
} from "../utils/versionBundles.mjs";
5252
import which from "which";
53-
import { homedir } from "os";
53+
import { homedir, platform } from "os";
5454
import { readFile } from "fs/promises";
5555
import { pyenvInstallPython, setupPyenv } from "../utils/pyenvUtil.mjs";
5656
import { existsSync, readdirSync } from "fs";
@@ -1354,6 +1354,7 @@ export class NewProjectPanel {
13541354

13551355
// Restrict the webview to only load specific scripts
13561356
const nonce = getNonce();
1357+
const isWindows = process.platform === "win32";
13571358

13581359
return `<!DOCTYPE html>
13591360
<html lang="en">
@@ -1570,8 +1571,12 @@ export class NewProjectPanel {
15701571
</span>
15711572
<input type="text" id="inp-project-location" class="w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-r-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-gray-500 dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="${
15721573
!this._isProjectImport
1573-
? "C:\\MyProject"
1574-
: "C:\\Project\\To\\Import"
1574+
? isWindows
1575+
? "C:\\MyProject"
1576+
: "/home/user/MyProject"
1577+
: isWindows
1578+
? "C:\\Project\\To\\Import"
1579+
: "/home/user/Project/To/Import"
15751580
}" disabled value="${
15761581
// support folder names with backslashes on linux and macOS
15771582
this._projectRoot !== undefined && process.platform === "win32"

0 commit comments

Comments
 (0)