Minor Update 3

This I think brings us up to a proper release. Since now we have installers and the Readme is finished.

changes to cli_utils.go:
```
- Add handling for a command to print out the current version of AllPac
```

changes to main.go:
```
- Add command to print out the current version of AllPac
```

Created and embedded .version file to facilitate above feature
This commit is contained in:
VetheonGames 2024-01-07 18:30:16 -07:00
parent 7676dcc021
commit 0e91ff7ba2
4 changed files with 29 additions and 29 deletions

View File

@ -5,7 +5,7 @@
AllPac is a command-line utility designed to simplify package management on Arch Linux by combining various package managers into one cohesive tool. With AllPac, users can seamlessly interact with packages from the Snap Store, Flatpak, Pacman, and the Arch User Repository (AUR) using a single interface. This eliminates the need to juggle multiple package managers and provides a unified solution for installing, updating, uninstalling, and searching for packages. AllPac is a command-line utility designed to simplify package management on Arch Linux by combining various package managers into one cohesive tool. With AllPac, users can seamlessly interact with packages from the Snap Store, Flatpak, Pacman, and the Arch User Repository (AUR) using a single interface. This eliminates the need to juggle multiple package managers and provides a unified solution for installing, updating, uninstalling, and searching for packages.
## Features ## Features
## NOTE: THIS IS PROBABLY WRONG!!! THE WAY THE FLAGS LIBRARY WORKED CREATED SOME UNINTENDED CLI SYNTAX, THIS WILL ALL BE FIXED ASAP
### 1. Unified Package Management ### 1. Unified Package Management
AllPac consolidates package management tasks from different sources, allowing users to handle Snap packages, Flatpaks, Pacman packages, and AUR packages all in one place. AllPac consolidates package management tasks from different sources, allowing users to handle Snap packages, Flatpaks, Pacman packages, and AUR packages all in one place.
@ -15,7 +15,7 @@ AllPac consolidates package management tasks from different sources, allowing us
Easily install packages from various sources with a straightforward installation command. AllPac intelligently recognizes the package type and fetches it from the appropriate repository. Easily install packages from various sources with a straightforward installation command. AllPac intelligently recognizes the package type and fetches it from the appropriate repository.
```bash ```bash
allpac install <package_name> allpac install <package_name> {or a list of packages}
``` ```
### 3. Updater ### 3. Updater
@ -23,7 +23,7 @@ allpac install <package_name>
Keep all your installed packages up-to-date with a single command. AllPac checks for updates across different repositories and ensures your system is current. Keep all your installed packages up-to-date with a single command. AllPac checks for updates across different repositories and ensures your system is current.
```bash ```bash
allpac update allpac update {everything/snap/flats/arch/aur}
``` ```
### 4. Uninstaller ### 4. Uninstaller
@ -31,7 +31,7 @@ allpac update
Remove packages cleanly and efficiently, regardless of their origin. AllPac ensures a consistent uninstallation process for Snap, Flatpak, Pacman, and AUR packages. Remove packages cleanly and efficiently, regardless of their origin. AllPac ensures a consistent uninstallation process for Snap, Flatpak, Pacman, and AUR packages.
```bash ```bash
allpac uninstall <package_name> allpac uninstall <package_name> {or a list of packages}
``` ```
### 5. Package Search ### 5. Package Search
@ -39,33 +39,15 @@ allpac uninstall <package_name>
Quickly find packages across Snap Store, Flatpak, Pacman, and AUR using the integrated search feature. Quickly find packages across Snap Store, Flatpak, Pacman, and AUR using the integrated search feature.
```bash ```bash
allpac search <query> allpac search <name of a package>
``` ```
## Installation ## Installation
To install AllPac on your Arch Linux system, follow these steps: To install AllPac on your Arch Linux system, simply run the following command to run the install script [Source](https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Installers/src/branch/main/allpac):
```bash
1. Clone the repository: curl -s https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Installers/raw/branch/main/allpac/install.sh | bash
```bash ```
git clone https://git.pixelridgesoftworks.com/PixelRidge-Softworks/AllPac.git
```
2. Navigate to the AllPac directory:
```bash
cd AllPac
```
### IGNORE THIS FOR RIGHT NOW
3. ~~Run the installer script:~~
~~```bash~~
~~./install.sh~~
~~```~~
Build the binary (this is temporary while testing is happening)
```bash
go build -o allpac
```
## Usage ## Usage
@ -77,8 +59,9 @@ Once installed, you can use AllPac with the following commands:
``` ```
- Update all installed packages: - Update all installed packages:
### WARNING: This will attempt to install all packages managed by AllPac across all sources! Be careful with this command!
```bash ```bash
allpac update allpac update everything
``` ```
- Update a specific installed package or packages: - Update a specific installed package or packages:
@ -86,6 +69,7 @@ Once installed, you can use AllPac with the following commands:
allpac update {package_name} allpac update {package_name}
``` ```
or or
```bash ```bash
allpac update {packagename1} {packagename2} {packagename3} allpac update {packagename1} {packagename2} {packagename3}
``` ```
@ -97,7 +81,7 @@ Once installed, you can use AllPac with the following commands:
- Search for packages: - Search for packages:
```bash ```bash
allpac search <query> allpac search <package_name>
``` ```
## Feedback and Contributions ## Feedback and Contributions

View File

@ -2,6 +2,9 @@ package main
import ( import (
"fmt" "fmt"
"embed"
"io/fs"
"pixelridgesoftworks.com/AllPac/pkg/logger"
) )
func handleUpdateError(updateOption string, err error) { func handleUpdateError(updateOption string, err error) {
@ -11,3 +14,14 @@ func handleUpdateError(updateOption string, err error) {
fmt.Printf("Update '%s' completed successfully.\n", updateOption) fmt.Printf("Update '%s' completed successfully.\n", updateOption)
} }
} }
//go:embed .version
var versionFS embed.FS
func handleVersion(args []string) {
content, err := fs.ReadFile(versionFS, ".version")
if err != nil {
logger.Errorf("Error reading version file: %v", err)
}
fmt.Println(string(content))
}

View File

@ -43,6 +43,8 @@ func main() {
handleCleanAur(args) handleCleanAur(args)
case "toolcheck": case "toolcheck":
handleToolCheck(args) handleToolCheck(args)
case "version":
handleVersion(args)
default: default:
fmt.Printf("Unknown subcommand: %s\n", command) fmt.Printf("Unknown subcommand: %s\n", command)
os.Exit(1) os.Exit(1)