Skip to content

Commit

Permalink
Install improvements (#351)
Browse files Browse the repository at this point in the history
Install improvements
  • Loading branch information
twpayne committed Jun 13, 2019
2 parents dc31e18 + a199a64 commit 89ecc76
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 16 deletions.
13 changes: 13 additions & 0 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ const (
methodSudoPrefix = "sudo-"

packageTypeNone = ""
packageTypeAUR = "aur"
packageTypeDEB = "deb"
packageTypeRPM = "rpm"
)

var (
packageTypeByID = map[string]string{
"amzn": packageTypeRPM,
"arch": packageTypeAUR,
"centos": packageTypeRPM,
"fedora": packageTypeRPM,
"opensuse": packageTypeRPM,
Expand Down Expand Up @@ -287,6 +289,17 @@ func (c *Config) upgradePackage(fs vfs.FS, mutator chezmoi.Mutator, rr *github.R
arch = archReplacement[arch]
}

// chezmoi does not build and distribute AUR packages, so instead rely
// on pacman and the communnity package.
if packageType == packageTypeAUR {
var args []string
if useSudo {
args = append(args, "sudo")
}
args = append(args, "pacman", "-S", c.upgrade.repo)
return c.run("", args[0], args[1:]...)
}

// Find the corresponding release asset.
var releaseAsset *github.ReleaseAsset
suffix := arch + "." + packageType
Expand Down
51 changes: 35 additions & 16 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,57 @@
# chezmoi Install Guide

* [macOS with Homebrew](#macos-with-homebrew)
* [Linux with Snap](#linux-with-snap)
* [One-line binary install](#one-line-binary-install)
* [Pre-built packages and binaries](#pre-built-packages-and-binaries)
* [One-line package install](#one-line-package-install)
* [Pre-built Linux packages](#pre-built-linux-packages)
* [Pre-built binaries](#pre-built-binaries)
* [From source](#from-source)
* [Upgrading](#upgrading)

## macOS with Homebrew
## One-line binary install

brew install twpayne/taps/chezmoi
Install the correct binary for your operating system and architecture with a
single command.

## Linux with Snap
curl -sfL https://git.io/chezmoi | sh

snap install chezmoi --classic
## One-line package install

## One-line binary install
Install chezmoi with a single command.

curl -sfL https://git.io/chezmoi | sh
| OS | Distribution | Method | Command |
| ----- | ------------ | ---------| ----------------------------------- |
| Linux | - | snap | `snap install chezmoi --classic` |
| Linux | Arch | pacman | `pacman -Ss chezmoi` |
| macOS | - | Homebrew | `brew install twpayne/taps/chezmoi` |

## Pre-built Linux packages

Download a package for your operating system and architecture and install it
with your package manager.

## Pre-built packages and binaries
| OS | Architectures | Package |
| ---------- | --------------------------------------------- | ------------------------------------------------------------------------- |
| Debian | amd64, arm64, armel, i386, ppc64, ppc64le | [`deb`](https://github.com/twpayne/chezmoi/releases/latest) |
| RedHat | aarch64, armhfp, i686, ppc64, ppc64le, x86_64 | [`rpm`](https://github.com/twpayne/chezmoi/releases/latest) |
| OpenSUSE | aarch64, armhfp, i686, ppc64, ppc64le, x86_64 | [`rpm`](https://github.com/twpayne/chezmoi/releases/latest) |
| Ubuntu | amd64, arm64, armel, i386, ppc64, ppc64le | [`deb`](https://github.com/twpayne/chezmoi/releases/latest) |

| OS | Architectures | Package |
## Pre-built binaries

Download a tarball for your operating system containing a pre-built binary and
documentation.

| OS | Architectures | Tarball |
| ---------- | --------------------------------------------- | -------------------------------------------------------------- |
| Arch Linux | i686, x86_64 | [`chezmoi`](https://www.archlinux.org/packages/community/x86_64/chezmoi/) |
| Debian | amd64, arm64, armel, i386, ppc64, ppc64le | [`deb`](https://github.com/twpayne/chezmoi/releases/latest) |
| RedHat | aarch64, armhfp, i686, ppc64, ppc64le, x86_64 | [`rpm`](https://github.com/twpayne/chezmoi/releases/latest) |
| OpenSUSE | aarch64, armhfp, i686, ppc64, ppc64le, x86_64 | [`rpm`](https://github.com/twpayne/chezmoi/releases/latest) |
| FreeBSD | amd64, arm, i386 | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| OpenBSD | amd64, arm, i386 | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| Linux | amd64, arm, arm64, i386, ppc64, ppc64le | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| macOS | amd64 | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| OpenBSD | amd64, arm, i386 | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |

## From source

Download, build, and install chezmoi for your system:

cd $(mktemp -d) && go get -u github.com/twpayne/chezmoi

## Upgrading
Expand Down
Binary file added images/logo-256px-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 89ecc76

Please sign in to comment.