fix
This commit is contained in:
@@ -78,6 +78,22 @@ function gitPluginStep(name, repo, destination) {
|
|||||||
return run(`clone ${name}`, "git", ["clone", 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) {
|
function sshAuthorizedKeyPlan(rawKey) {
|
||||||
const key = (rawKey || "").trim();
|
const key = (rawKey || "").trim();
|
||||||
if (!key) {
|
if (!key) {
|
||||||
@@ -347,6 +363,7 @@ module.exports = {
|
|||||||
zshInstallPlan,
|
zshInstallPlan,
|
||||||
sshInstallPlan,
|
sshInstallPlan,
|
||||||
sshAuthorizedKeyPlan,
|
sshAuthorizedKeyPlan,
|
||||||
|
condaInstallPlan,
|
||||||
frpInstallPlan,
|
frpInstallPlan,
|
||||||
frpInitConfigPlan,
|
frpInitConfigPlan,
|
||||||
frpAddProxyPlan,
|
frpAddProxyPlan,
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import React from "react";
|
|||||||
import { Box, Text } from "ink";
|
import { Box, Text } from "ink";
|
||||||
import SelectInput from "ink-select-input";
|
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 }) {
|
export default function MainMenu({ nav }) {
|
||||||
const items = [
|
const items = [
|
||||||
{ label: "Install zsh + oh-my-zsh + nvm", value: "zsh" },
|
{ label: "Install zsh + oh-my-zsh + nvm", value: "zsh" },
|
||||||
{ label: "Install OpenSSH server", value: "ssh" },
|
{ label: "Install OpenSSH server", value: "ssh" },
|
||||||
{ label: "Add SSH public key to authorized_keys", value: "ssh-key" },
|
{ 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: "FRP setup ▸", value: "frp" },
|
||||||
{ label: "Bootstrap (zsh + ssh + frp)", value: "bootstrap" },
|
{ label: "Bootstrap (zsh + ssh + frp)", value: "bootstrap" },
|
||||||
{ label: "Quit", value: "quit" },
|
{ label: "Quit", value: "quit" },
|
||||||
@@ -25,6 +26,9 @@ export default function MainMenu({ nav }) {
|
|||||||
case "ssh-key":
|
case "ssh-key":
|
||||||
nav.push({ name: "ssh-key" });
|
nav.push({ name: "ssh-key" });
|
||||||
return;
|
return;
|
||||||
|
case "conda":
|
||||||
|
nav.push({ name: "plan", props: { plan: condaInstallPlan(), origin: "main" } });
|
||||||
|
return;
|
||||||
case "frp":
|
case "frp":
|
||||||
nav.push({ name: "frp" });
|
nav.push({ name: "frp" });
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user