kpfromer-arch-install
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -34,4 +34,4 @@ "use strict"; | ||
const names = packages | ||
.split('\n') | ||
.map((line) => line.split(' ')[0]) | ||
.split("\n") | ||
.map((line) => line.split(" ")[0]) | ||
.filter((line) => line.length > 0); | ||
@@ -41,6 +41,6 @@ const csvWriter = csv_writer_1.createObjectCsvWriter({ | ||
header: [ | ||
{ id: 'type', title: 'type' }, | ||
{ id: 'name', title: 'name' }, | ||
{ id: 'description', title: 'description' } | ||
] | ||
{ id: "type", title: "type" }, | ||
{ id: "name", title: "name" }, | ||
{ id: "description", title: "description" }, | ||
], | ||
}); | ||
@@ -53,3 +53,3 @@ let rows = []; | ||
if (!!official) { | ||
rows.push({ type: '', name, description: official.pkgdesc }); | ||
rows.push({ type: "", name, description: official.pkgdesc }); | ||
continue; | ||
@@ -59,7 +59,7 @@ } | ||
if (!!aur) { | ||
rows.push({ type: 'A', name, description: aur.Description }); | ||
rows.push({ type: "A", name, description: aur.Description }); | ||
continue; | ||
} | ||
} | ||
rows.push({ type: '', name, description: '' }); | ||
rows.push({ type: "", name, description: "" }); | ||
} | ||
@@ -75,3 +75,3 @@ yield csvWriter.writeRecords(rows); | ||
yield arch_1.installYay(username); | ||
aur = 'yay'; | ||
aur = "yay"; | ||
} | ||
@@ -81,11 +81,11 @@ const rows = yield csv_1.readCsv(path, { | ||
ignoreEmpty: true, | ||
comment: '#' | ||
comment: "#", | ||
}); | ||
const gauge = new Gauge(); | ||
gauge.show('Starting Installation.', 0); | ||
gauge.show("Starting Installation.", 0); | ||
let count = 0; | ||
for (let { type, name, description } of rows) { | ||
gauge.show(`Installing "${chalk_1.default.blue(name)}"` + | ||
(!!description ? ` (${chalk_1.default.green(description)})` : ''), count / rows.length); | ||
yield shell_1.execShellCommand(`${type === 'A' ? 'yay' : 'sudo pacman'} -S --noconfirm ${name}`, username); | ||
(!!description ? ` (${chalk_1.default.green(description)})` : ""), count / rows.length); | ||
yield shell_1.execShellCommand(`${type === "A" ? "yay" : "sudo pacman"} -S --noconfirm ${name}`, username); | ||
count++; | ||
@@ -108,44 +108,46 @@ } | ||
{ | ||
name: 'username', | ||
type: 'input', | ||
name: "username", | ||
type: "input", | ||
message: "New user's name?", | ||
validate: (username) => { | ||
if (username.length === 0) | ||
return 'The username can not be empty'; | ||
return "The username can not be empty"; | ||
return true; | ||
} | ||
}, | ||
}, | ||
{ | ||
name: 'password', | ||
type: 'password', | ||
message: 'User password?' | ||
name: "password", | ||
type: "password", | ||
message: "User password?", | ||
}, | ||
{ | ||
name: 'confirmPassword', | ||
type: 'password', | ||
message: 'Confirm password?', | ||
name: "confirmPassword", | ||
type: "password", | ||
message: "Confirm password?", | ||
validate: (confirmPassword, values) => { | ||
if (confirmPassword !== (values === null || values === void 0 ? void 0 : values.password)) | ||
return 'Passwords do not match!'; | ||
return "Passwords do not match!"; | ||
return true; | ||
} | ||
}, | ||
}, | ||
{ | ||
name: 'install', | ||
type: 'confirm', | ||
message: 'Ready to install?', | ||
default: false | ||
} | ||
name: "install", | ||
type: "confirm", | ||
message: "Ready to install?", | ||
default: false, | ||
}, | ||
]); | ||
if (install) { | ||
console.log('Starting Install.'); | ||
console.log("Starting Install."); | ||
yield shell_1.execShellCommand(`useradd ${username} -m -G wheel && ${username}:${password} | chpasswd`); | ||
yield shell_1.execShellCommand(`echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers`); | ||
console.log("Enabling Services."); | ||
for (let service of services) | ||
yield enableService(service); | ||
yield downloadPackages(path, 'yay'); | ||
console.log('All done! You should reboot.'); | ||
console.log("Downloading Packages."); | ||
yield downloadPackages(path, "yay"); | ||
console.log("All done! You should reboot."); | ||
} | ||
else { | ||
console.warn('Not Installing!'); | ||
console.warn("Not Installing!"); | ||
} | ||
@@ -152,0 +154,0 @@ }); |
{ | ||
"name": "kpfromer-arch-install", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "An arch mass package installer.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14949
328