@@ -47,9 +47,9 @@ function zshInstallPlan() {
|
|||||||
const syntaxHighlightingDir = path.join(customDir, "plugins", "zsh-syntax-highlighting");
|
const syntaxHighlightingDir = path.join(customDir, "plugins", "zsh-syntax-highlighting");
|
||||||
|
|
||||||
const steps = [
|
const steps = [
|
||||||
run("apt update", "sudo", ["apt", "update"]),
|
run("apt update", "sudo", aptArgs("update")),
|
||||||
run("apt upgrade", "sudo", ["apt", "upgrade", "-y"]),
|
run("apt upgrade", "sudo", aptArgs("upgrade", "-y")),
|
||||||
run("install zsh & friends", "sudo", ["apt", "install", "zsh", "git", "curl", "wget", "-y"]),
|
run("install zsh & friends", "sudo", aptArgs("install", "zsh", "git", "curl", "wget", "-y")),
|
||||||
run("git credential helper = store", "git", ["config", "--global", "credential.helper", "store"]),
|
run("git credential helper = store", "git", ["config", "--global", "credential.helper", "store"]),
|
||||||
run("change shell to zsh", "sudo", ["chsh", "-s", "/bin/zsh", os.userInfo().username]),
|
run("change shell to zsh", "sudo", ["chsh", "-s", "/bin/zsh", os.userInfo().username]),
|
||||||
run("install oh-my-zsh", "sh", ["-c", OH_MY_ZSH_COMMAND]),
|
run("install oh-my-zsh", "sh", ["-c", OH_MY_ZSH_COMMAND]),
|
||||||
@@ -125,8 +125,8 @@ function sshInstallPlan() {
|
|||||||
return {
|
return {
|
||||||
title: "Install OpenSSH server",
|
title: "Install OpenSSH server",
|
||||||
steps: [
|
steps: [
|
||||||
run("apt update", "sudo", ["apt", "update"]),
|
run("apt update", "sudo", aptArgs("update")),
|
||||||
run("install openssh-server", "sudo", ["apt", "install", "openssh-server", "-y"]),
|
run("install openssh-server", "sudo", aptArgs("install", "openssh-server", "-y")),
|
||||||
run("enable + start ssh", "sudo", ["systemctl", "enable", "--now", "ssh"]),
|
run("enable + start ssh", "sudo", ["systemctl", "enable", "--now", "ssh"]),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -351,6 +351,18 @@ function requireToken(value) {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function aptArgs(...args) {
|
||||||
|
return [
|
||||||
|
"DEBIAN_FRONTEND=noninteractive",
|
||||||
|
"NEEDRESTART_MODE=a",
|
||||||
|
"NEEDRESTART_SUSPEND=1",
|
||||||
|
"apt-get",
|
||||||
|
"-o", "Dpkg::Options::=--force-confold",
|
||||||
|
"-o", "Dpkg::Options::=--force-confdef",
|
||||||
|
...args,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
function run(label, command, args) {
|
function run(label, command, args) {
|
||||||
return { kind: "run", label, command, args };
|
return { kind: "run", label, command, args };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user