{"modulePath":"github.com/developomp/pompup","version":"v0.0.0-20240902034517-13e574e70f7f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package wrapper\n\nPackage wrapper abstracts away OS-native operations like package installation and writing to file as root.\n\n## Constants\n\n```go\nconst DefaultDirPerm = 0755\n```\nDefaultDirPerm is equivalent to -rwxr-xr-x\n\n```go\nconst DefaultFilePerm = 0644\n```\nDefaultFilePerm is equivalent to -rw-r--r--\n\n```go\nconst TmpDir = \"/tmp/pompup\"\n```\n⚠️ ⚠️ ⚠️ ⚠️ ⚠️ BE FUCKING CAREFUL WHEN CHANGING THIS IT IS USED WITH \"rm -rf\" IT MIGHT KDE6 THE SHIT OUT OF YOUR HOME DIR ⚠️ ⚠️ ⚠️ ⚠️ ⚠️\n\n## Variables\n\n```go\nvar (\n\tErrStartupNotLinux      error = errors.New(\"platform is not Linux\")\n\tErrStartupRunningAsRoot error = errors.New(\"program running as root\")\n\tErrStartupNoPacman      error = errors.New(\"pacman is not installed\")\n\tErrStartupNoSudo        error = errors.New(\"sudo is not installed\")\n)\n```\nStartup error\n\n## Functions\n\n```go\nfunc AddGroup(group string)\n```\nAddGroup adds the user to group if the user is not part of the group already.\n\n```go\nfunc BashRun(command string) error\n```\nBashRun runs a command as if it was typed out in a bash shell. This allows the usage of piping among other stuff.\n\n```go\nfunc Dconf(data string) error\n```\nDconf loads dconf configuration from string\n\n```go\nfunc DownloadFromGitHub(user, repo, filePattern string)\n```\nDownloadFromGitHub downloads a file from GitHub releases to ~/Downloads directory without installing it. The user has to manually install it using gearlever.\n\n```go\nfunc Flatpak(appID string) error\n```\nFlatpak installs flatpak packages.\n\n```go\nfunc FlatpakOnce(packageName string)\n```\nFlatpakOnce acts like Flatpak but skips when the package is installed already.\n\n```go\nfunc GetHomeDir() string\n```\n\n```go\nfunc GetUserName() string\n```\n\n```go\nfunc InHome(path string) string\n```\n\n```go\nfunc IsAppImageInstalled(packageName string) bool\n```\n\n```go\nfunc IsArchPkgInstalled(packageName string) bool\n```\nIsArchPkgInstalled checks if an arch package has been installed already.\n\n```go\nfunc IsBinInstalled(command string) bool\n```\nIsBinInstalled checks if a file can be found in PATH.\n\n```go\nfunc IsFileInDir(dirPath, filePattern string) bool\n```\n\n```go\nfunc IsFileUpToDate(filePath string, s string) bool\n```\nIsFileUpToDate checks if a file's content matches string s.\n\n```go\nfunc IsFlatpakInstalled(packageName string) bool\n```\nIsFlatpakInstalled checks if a flatpak package has been installed already.\n\n```go\nfunc IsLinux() bool\n```\nIsLinux checks if the program is running on a Linux-based Operating System.\n\n```go\nfunc IsNixInstalled(packageName string) bool\n```\nIsNixInstalled checks if a nix package has been installed already.\n\n```go\nfunc IsRoot() bool\n```\nIsRoot checks if the program is running with root permission.\n\n```go\nfunc Nix(packageName string) error\n```\nNix installs nix packages.\n\n```go\nfunc NixOnce(packageName string)\n```\nNixOnce acts like Nix but skips when the package is installed already.\n\n```go\nfunc Pacman(packageName string) error\n```\nPacman installs Arch Linux packages using pacman. It can not install packages from the AUR.\n\n```go\nfunc PacmanOnce(packageName string)\n```\nPacmanOnce acts like Pacman but skips when the package is installed already.\n\n```go\nfunc Paru(packageName string) error\n```\nParu installs Arch Linux packages using paru. It can also install packages from the AUR.\n\n```go\nfunc ParuOnce(packageName string)\n```\nParuOnce acts like Paru but skips when the package is installed already.\n\n```go\nfunc PathExists(path string) bool\n```\nPathExists checks whether the given path exists or not\n\n```go\nfunc ReadFile(filePath string) (content string, fileExists bool)\n```\n\n```go\nfunc RegexMatch(pattern string, s string) bool\n```\n\n```go\nfunc Run(name string, arg ...string) error\n```\n\n```go\nfunc StartupCheck() error\n```\nStartupCheck checks whether there are any irrecoverable issues in the system that prevents the program to begin installing.\n\n```go\nfunc SudoWriteFile(path string, data string)\n```\nSudoWriteFile writes data to path where file is owned by root. It can safely perform multiple operations on the same path.\n\n```go\nfunc SystemctlEnable(service string, now Now)\n```\n\n```go\nfunc TryDconf(data string)\n```\nTryDconf tries to load dconf configuration from string then terminates program if it fails.\n\n```go\nfunc WriteFile(filePath string, data []byte)\n```\nWriteFile writes data to path. It can safely perform multiple operations on the same path.\n\n## Types\n\n```go\ntype Now bool\n```\n\n```go\nconst EnableNow Now = true\n```\n\n```go\nconst EnableOnly Now = false\n```\n\n","path":"github.com/developomp/pompup/internal/wrapper","name":"wrapper","synopsis":"Package wrapper abstracts away OS-native operations like package installation and writing to file as root.","isRedistributable":true}
