Skip to content

Commit

Permalink
link python3.10 for osx
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <daisuke.nishimatsu1021@gmail.com>
  • Loading branch information
wep21 committed Apr 29, 2024
1 parent e024e71 commit 1f74a6a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6752,7 +6752,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.installBrewDependencies = exports.runBrew = void 0;
exports.linkBrewPython = exports.installBrewDependencies = exports.runBrew = void 0;
const utils = __importStar(__nccwpck_require__(1314));
const brewDependencies = [
"asio",
Expand Down Expand Up @@ -6801,6 +6801,17 @@ function installBrewDependencies() {
});
}
exports.installBrewDependencies = installBrewDependencies;
/**
* Run brew link to pin specific python.
*
* @returns Promise<number> exit code
*/
function linkBrewPython() {
return __awaiter(this, void 0, void 0, function* () {
return utils.exec("brew", ["link", "--overwrite", "python@3.10"]);
});
}
exports.linkBrewPython = linkBrewPython;


/***/ }),
Expand Down Expand Up @@ -7356,6 +7367,7 @@ const pip = __importStar(__nccwpck_require__(6744));
function runOsX() {
return __awaiter(this, void 0, void 0, function* () {
yield brew.installBrewDependencies();
yield brew.linkBrewPython();
yield utils.exec("sudo", [
"bash",
"-c",
Expand Down
9 changes: 9 additions & 0 deletions src/package_manager/brew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ export async function runBrew(packages: string[]): Promise<number> {
export async function installBrewDependencies(): Promise<number> {
return runBrew(brewDependencies);
}

/**
* Run brew link to pin specific python.
*
* @returns Promise<number> exit code
*/
export async function linkBrewPython(): Promise<number> {
return utils.exec("brew", ["link", "--overwrite", "python@3.10"]);
}
1 change: 1 addition & 0 deletions src/setup-ros-osx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as pip from "./package_manager/pip";
*/
export async function runOsX() {
await brew.installBrewDependencies();
await brew.linkBrewPython();
await utils.exec("sudo", [
"bash",
"-c",
Expand Down

0 comments on commit 1f74a6a

Please sign in to comment.