Feat: conditional permissions behavior (#28)
* Fix: don't need sudo if we're root + other aesthetics
* Heavy refactoring, see PR #28
* Fix: avoid silent fatalities
demo: https://tcp.ac/i/JMSUc.gif
* Fix: Inverse check on `IsRoot`
* D.R.Y: check for permissions error in `common.ErrorCheck`
Reduce cognitive complexity.
* Fix: Issue with copying
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646535918
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646606680 and https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646594105
* Revert "Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646606680 and https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646594105"
This reverts commit ce15213009
.
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646730751
This commit is contained in:
parent
4d0086df41
commit
6c48a35180
21 changed files with 604 additions and 255 deletions
|
@ -10,14 +10,14 @@ import (
|
|||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
)
|
||||
|
||||
// This function copies the content of /etc/mkinitcpio.conf to the config folder and does an inline replace/insert on the MODULES=() line
|
||||
// Set_Mkinitcpio copies the content of /etc/mkinitcpio.conf to the config folder and does an inline replace/insert on the MODULES=() line
|
||||
func Set_Mkinitcpio() {
|
||||
// Get the config struct
|
||||
config := GetConfig()
|
||||
|
||||
// Make sure we start from scratch by deleting any old file
|
||||
if fileio.FileExist(config.Path.MKINITCPIO) {
|
||||
os.Remove(config.Path.MKINITCPIO)
|
||||
if exists, _ := fileio.FileExist(config.Path.MKINITCPIO); exists {
|
||||
_ = os.Remove(config.Path.MKINITCPIO)
|
||||
}
|
||||
|
||||
// Make a regex to get the system path instead of the config path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue