Print correct command for installing a package.
Project description
installcmd
Cross platform package install commands.
I use a lot of cross platform software. One annoying thing about it is that every platform has its own package manager with a unique install command. What's even worse is that sometimes the packages themselves are listed under slightly different names in different repositories. Installcmd solves this by detecting your platform and providing the correct command.
Installation
Install with: pip install installcmd
Usage
installcmd
prints the install command, eg.:apt-get install
installcmd refresh
prints the package cache update command, eg.:apt-get update
installcmd refresh
prints the non-interactive install command, eg.:apt-get install --assume-yes
installcmd pkgspec foo.yml
prints the correct name of the package for that platform, based on information in thefoo.yml
.
Installcmd just prints the command, but it's easy to make your shell execute it:
# Without spec
$ $(installcmd) package-name
# With spec
$ $(installcmd pkgspec docker.yaml)
It's not magic. It searches through a built-in list of commands for various platforms (see contribution guide). The package name specs have to be provided by you (see package specs).
The main use of this is writing portable installation scripts, such as in your dotfiles repo or Dockerfiles. You can let installcmd handle the platform detection logic instead of having to reimplement it again and again, which makes the scripts a lot cleaner.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for installcmd-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4374429ed4833163511a1045b05f1ee657c74b0032d610c4b0666c5a18ece797 |
|
MD5 | 40b0b36b7d4c9f86b1af636b4ebe1fed |
|
BLAKE2b-256 | f271dae0f903096e2cbecac1aaf795fc90453dc2f3d8f4003a28138e957c9080 |