create-huenei-frontend 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,12 @@ function installPnpm() {
|
|
|
25
25
|
const platform = process.platform;
|
|
26
26
|
console.log("📦 Installing pnpm...");
|
|
27
27
|
try {
|
|
28
|
-
//
|
|
28
|
+
// 👉 WINDOWS: usar installer oficial (NO corepack)
|
|
29
|
+
if (platform === "win32") {
|
|
30
|
+
execSync('powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest https://get.pnpm.io/install.ps1 -UseBasicParsing | Invoke-Expression"', { stdio: "inherit" });
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
// 👉 macOS / Linux: corepack si existe
|
|
29
34
|
if (commandExists("corepack")) {
|
|
30
35
|
execSync("corepack enable", { stdio: "inherit" });
|
|
31
36
|
execSync("corepack prepare pnpm@latest --activate", {
|
|
@@ -33,18 +38,12 @@ function installPnpm() {
|
|
|
33
38
|
});
|
|
34
39
|
return;
|
|
35
40
|
}
|
|
36
|
-
//
|
|
37
|
-
if (platform === "win32") {
|
|
38
|
-
// Windows sin corepack → PowerShell installer
|
|
39
|
-
execSync('powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr https://get.pnpm.io/install.ps1 -useb | iex"', { stdio: "inherit" });
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
// macOS / Linux → shell script
|
|
41
|
+
// 👉 fallback unix
|
|
43
42
|
execSync("curl -fsSL https://get.pnpm.io/install.sh | sh -", {
|
|
44
43
|
stdio: "inherit",
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
|
-
catch
|
|
46
|
+
catch {
|
|
48
47
|
throw new Error("Failed to install pnpm automatically. Please install it manually from https://pnpm.io/installation");
|
|
49
48
|
}
|
|
50
49
|
}
|