Skip to content

Commit

Permalink
added explicit commands e.g. curate-pkg -i vlc
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei PAVEL committed Jan 15, 2018
1 parent 876cc13 commit 32aedf4
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 103 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# curate-pkg

One-file installation tool for various package managers: `apt`, `dnf`, `eopkg`, `flatpak`, `go`, `npm`, `pacaur`, `pacman`, `snap`, `yaourt`
Are you a distro-hopper? Then take this with you wherever you hop.

All you need to carry your packages with you. Add keys, sources, repositories, install and purge all continuously or at your discretion. Allows for easy reinstall of packages when distro-hoping or just switching between machines.
Are you a distro-hugger? This one-file installation tool for various package managers is for you.

Supported package managers:
- `apt`
- `dnf`
- `eopkg`
- `flatpak`
- `go`
- `npm`
- `pacaur`
- `pacman`
- `snap`
- `yaourt`

## Installation

Expand Down Expand Up @@ -32,7 +44,24 @@ Samples:

## Usage

Simply run `curate-pkg` everyday to keep all your packages up to date.
`curate-pkg --help`

```sh
Usage: curate-pkg [options]
Options:
[-d|--debug] Enable debug.
[-h|--help] Display this help.
[-a|--auto] Cool continuous curation
[-v|--verbose] Verbose output
[-i|--install $package] Installs a single package.
[-k|--add-key $key] Adds a single key.
[-p|--purge|--remove $package] Removes a single package.
[-r|--add-repository $repository] Adds a single repository.
[-s|--add-source $source] Adds a single source.
[-u|--upgrade $package] Upgrades a single package.
```

Run `curate-pkg` everyday to keep all your packages up to date.

When installing a new package, add it to `installables`, `wgetables` or `sources` and `keys` in `~/.config/curate-pkg/*.yaml`.

Expand Down
58 changes: 53 additions & 5 deletions bin/curate-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@
set -e

# Print usage function.
printUsage() {
function printUsage() {
printf "\
Usage: $(basename "${0}") [options]
Options:
[-d|--debug] Enable debug.
[-h|--help] Display this help.
[-a|--auto] Cool continuous curation
[-v|--verbose] Verbose output
[-d|--debug] Enable debug.
[-h|--help] Display this help.
[-a|--auto] Cool continuous curation
[-v|--verbose] Verbose output
[-i|--install \$package] Installs a single package.
[-k|--add-key \$key] Adds a single key.
[-p|--purge|--remove \$package] Removes a single package.
[-r|--add-repository \$repository] Adds a single repository.
[-s|--add-source \$source] Adds a single source.
[-u|--upgrade \$package] Upgrades a single package.
"
}

Expand Down Expand Up @@ -55,6 +61,48 @@ while [[ ${#} -ge 1 ]]; do
auto=true
continue
fi
# install
if [[ "${1}" == "-i" || "${1}" == "--install" ]]; then
shift
additional+=" -i ${1}"
shift
continue
fi
# add-key
if [[ "${1}" == "-k" || "${1}" == "--add-key" ]]; then
shift
additional+=" -k ${1}"
shift
continue
fi
# purge
if [[ "${1}" == "-p" || "${1}" == "--purge" || "${1}" == "--remove" ]]; then
shift
additional+=" -p ${1}"
shift
continue
fi
# add-repository
if [[ "${1}" == "-r" || "${1}" == "--add-repository" ]]; then
shift
additional+=" -r ${1}"
shift
continue
fi
# add-source
if [[ "${1}" == "-s" || "${1}" == "--add-source" ]]; then
shift
additional+=" -s ${1}"
shift
continue
fi
# update
if [[ "${1}" == "-u" || "${1}" == "--upgrade" ]]; then
shift
additional+=" -u ${1}"
shift
continue
fi
# Verbose output
if [[ "${1}" == "-v" || "${1}" == "--verbose" ]]; then
shift
Expand Down
Loading

0 comments on commit 32aedf4

Please sign in to comment.