create-sitekick 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1318,18 +1318,11 @@ async function ensureBrew(s) {
1318
1318
  s.stop("Failed to install Homebrew");
1319
1319
  return false;
1320
1320
  }
1321
- const brewPaths = ["/opt/homebrew/bin/brew", "/usr/local/bin/brew"];
1322
- for (const brewPath of brewPaths) {
1323
- try {
1324
- const shellEnv = execSync(`${brewPath} shellenv`, { encoding: "utf-8" });
1325
- for (const line of shellEnv.split(`
1326
- `)) {
1327
- const match = line.match(/export\s+PATH="([^"]+)"/);
1328
- if (match)
1329
- process.env.PATH = `${match[1]}:${process.env.PATH}`;
1330
- }
1331
- break;
1332
- } catch {}
1321
+ const brewDirs = ["/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", "/usr/local/sbin"];
1322
+ const currentPath = process.env.PATH || "";
1323
+ const newDirs = brewDirs.filter((d2) => !currentPath.includes(d2));
1324
+ if (newDirs.length > 0) {
1325
+ process.env.PATH = `${newDirs.join(":")}:${currentPath}`;
1333
1326
  }
1334
1327
  if (!isInstalled("brew")) {
1335
1328
  s.stop("Homebrew installed but not found on PATH. Restart your terminal and try again.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitekick",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Scaffold a new Sitekick project with your choice of CMS",
5
5
  "type": "module",
6
6
  "bin": {