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.
- package/dist/index.js +5 -12
- 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
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
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.");
|