Documentation ¶
Overview ¶
Package wrapper abstracts away OS-native operations like package installation and writing to file as root.
Index ¶
- Constants
- Variables
- func AddGroup(group string)
- func BashRun(command string) error
- func Dconf(data string) error
- func Flatpak(appID string) error
- func FlatpakOnce(packageName string)
- func GetHomeDir() string
- func GetUserName() string
- func InHome(path string) string
- func IsArchPkgInstalled(packageName string) bool
- func IsBinInstalled(command string) bool
- func IsFileUpdated(filePath string, s string) bool
- func IsFlatpakInstalled(packageName string) bool
- func IsLinux() bool
- func IsRoot() bool
- func Pacman(packageName string) error
- func PacmanOnce(packageName string)
- func Paru(packageName string) error
- func ParuOnce(packageName string)
- func PathExists(path string) bool
- func ReadFile(filePath string) (content string, fileExists bool)
- func Run(name string, arg ...string) error
- func StartupCheck() error
- func SudoWriteFile(path string, data string)
- func SystemctlEnable(service string)
- func TryDconf(data string)
- func WriteFile(filePath string, data []byte)
Constants ¶
const DefaultDirPerm = 0755
DefaultDirPerm is equivalent to -rwxr-xr-x
const DefaultFilePerm = 0644
DefaultFilePerm is equivalent to -rw-r--r--
const TmpDir = "/tmp/pompup"
⚠️ ⚠️ ⚠️ ⚠️ ⚠️ BE FUCKING CAREFUL WHEN CHANGING THIS IT IS USED WITH "rm -rf" IT MIGHT KDE6 THE SHIT OUT OF YOUR HOME DIR ⚠️ ⚠️ ⚠️ ⚠️ ⚠️
Variables ¶
var ( ErrStartupNotLinux error = errors.New("platform is not Linux") ErrStartupRunningAsRoot error = errors.New("program running as root") ErrStartupNoPacman error = errors.New("pacman is not installed") ErrStartupNoSudo error = errors.New("sudo is not installed") )
Startup error
Functions ¶
func AddGroup ¶
func AddGroup(group string)
AddGroup adds the user to group if the user is not part of the group already.
func BashRun ¶
BashRun runs a command as if it was typed out in a bash shell. This allows the usage of piping among other stuff.
func FlatpakOnce ¶
func FlatpakOnce(packageName string)
FlatpakOnce acts like Flatpak but skips when the package is installed already.
func GetHomeDir ¶
func GetHomeDir() string
func GetUserName ¶
func GetUserName() string
func IsArchPkgInstalled ¶
IsArchPkgInstalled checks if an arch package has been installed already.
func IsBinInstalled ¶
IsBinInstalled checks if a file can be found in PATH.
func IsFileUpdated ¶
IsFileUpdated checks if file's content is already s.
func IsFlatpakInstalled ¶
IsFlatpakInstalled checks if an flatpak package has been installed already.
func IsLinux ¶
func IsLinux() bool
IsLinux checks if the program is running on a Linux-based Operating System.
func Pacman ¶
Pacman installs Arch Linux packages using pacman. It can not install packages from the AUR.
func PacmanOnce ¶
func PacmanOnce(packageName string)
PacmanOnce acts like Pacman but skips when the package is installed already.
func Paru ¶
Paru installs Arch Linux packages using paru. It can also install packages from the AUR.
func ParuOnce ¶
func ParuOnce(packageName string)
ParuOnce acts like Paru but skips when the package is installed already.
func PathExists ¶
PathExists checks whether the given path exists or not
func StartupCheck ¶
func StartupCheck() error
StartupCheck checks whether there are any irrecoverable issues in the system that prevents the program to begin installing.
func SudoWriteFile ¶
SudoWriteFile writes data to path where file is owned by root. It can safely perform multiple operations on the same path.
func SystemctlEnable ¶
func SystemctlEnable(service string)
Types ¶
This section is empty.