Skip to content

Commit

Permalink
Fix #44, Replace project location placeholders with platform dependen…
Browse files Browse the repository at this point in the history
…t hints

Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
  • Loading branch information
paulober committed Aug 19, 2024
1 parent 188e027 commit 1f26dcc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/webview/newProjectPanel.mts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import VersionBundlesLoader, {
type VersionBundle,
} from "../utils/versionBundles.mjs";
import which from "which";
import { homedir } from "os";
import { homedir, platform } from "os";

Check warning on line 53 in src/webview/newProjectPanel.mts

View workflow job for this annotation

GitHub Actions / build

'platform' is defined but never used
import { readFile } from "fs/promises";
import { pyenvInstallPython, setupPyenv } from "../utils/pyenvUtil.mjs";
import { existsSync, readdirSync } from "fs";
Expand Down Expand Up @@ -1354,6 +1354,7 @@ export class NewProjectPanel {

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

return `<!DOCTYPE html>
<html lang="en">
Expand Down Expand Up @@ -1570,8 +1571,12 @@ export class NewProjectPanel {
</span>
<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="${
!this._isProjectImport
? "C:\\MyProject"
: "C:\\Project\\To\\Import"
? isWindows
? "C:\\MyProject"
: "/home/user/MyProject"
: isWindows
? "C:\\Project\\To\\Import"
: "/home/user/Project/To/Import"
}" disabled value="${
// support folder names with backslashes on linux and macOS
this._projectRoot !== undefined && process.platform === "win32"
Expand Down

0 comments on commit 1f26dcc

Please sign in to comment.