From 01ad11010f600ab4b7ee5b3adcbdb363baed9742 Mon Sep 17 00:00:00 2001 From: hanruo <552455797@qq.com> Date: Fri, 22 May 2026 14:39:21 +0800 Subject: [PATCH] fix --- src/lib/tasks.js | 17 +++++++++++++++++ src/screens/MainMenu.jsx | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/lib/tasks.js b/src/lib/tasks.js index 8e508de..8f62556 100644 --- a/src/lib/tasks.js +++ b/src/lib/tasks.js @@ -78,6 +78,22 @@ function gitPluginStep(name, repo, destination) { return run(`clone ${name}`, "git", ["clone", repo, destination]); } +function condaInstallPlan(options = {}) { + const installDir = options.installDir || path.join(os.homedir(), "miniconda3"); + const installer = "/tmp/Miniconda3-latest-Linux-x86_64.sh"; + const url = "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; + const condaBin = path.join(installDir, "bin", "conda"); + + return { + title: `Install Miniconda → ${installDir}`, + steps: [ + run("download miniconda installer", "wget", ["-O", installer, url]), + run("run miniconda installer", "bash", [installer, "-b", "-p", installDir]), + run("conda init zsh", condaBin, ["init", "zsh"]), + ], + }; +} + function sshAuthorizedKeyPlan(rawKey) { const key = (rawKey || "").trim(); if (!key) { @@ -347,6 +363,7 @@ module.exports = { zshInstallPlan, sshInstallPlan, sshAuthorizedKeyPlan, + condaInstallPlan, frpInstallPlan, frpInitConfigPlan, frpAddProxyPlan, diff --git a/src/screens/MainMenu.jsx b/src/screens/MainMenu.jsx index 9ea650b..ae56e75 100644 --- a/src/screens/MainMenu.jsx +++ b/src/screens/MainMenu.jsx @@ -2,13 +2,14 @@ import React from "react"; import { Box, Text } from "ink"; import SelectInput from "ink-select-input"; -import { zshInstallPlan, sshInstallPlan } from "../lib/tasks.js"; +import { zshInstallPlan, sshInstallPlan, condaInstallPlan } from "../lib/tasks.js"; export default function MainMenu({ nav }) { const items = [ { label: "Install zsh + oh-my-zsh + nvm", value: "zsh" }, { label: "Install OpenSSH server", value: "ssh" }, { label: "Add SSH public key to authorized_keys", value: "ssh-key" }, + { label: "Install Miniconda (+ conda init zsh)", value: "conda" }, { label: "FRP setup ▸", value: "frp" }, { label: "Bootstrap (zsh + ssh + frp)", value: "bootstrap" }, { label: "Quit", value: "quit" }, @@ -25,6 +26,9 @@ export default function MainMenu({ nav }) { case "ssh-key": nav.push({ name: "ssh-key" }); return; + case "conda": + nav.push({ name: "plan", props: { plan: condaInstallPlan(), origin: "main" } }); + return; case "frp": nav.push({ name: "frp" }); return;