Files
topgrade/README.md

100 lines
4.9 KiB
Markdown
Raw Normal View History

2018-06-28 12:04:56 +03:00
# Topgrade
[![Travis](https://api.travis-ci.org/r-darwish/topgrade.svg?branch=master)](https://travis-ci.org/r-darwish/topgrade)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/r-darwish/topgrade?svg=true)](https://ci.appveyor.com/project/r-darwish/topgrade)
2018-08-29 14:40:59 +03:00
![GitHub release](https://img.shields.io/github/release/r-darwish/topgrade.svg)
2018-07-05 13:01:43 +03:00
[![Crates.io](https://img.shields.io/crates/v/topgrade.svg)](https://crates.io/crates/topgrade)
2018-08-22 16:59:28 +03:00
[![AUR](https://img.shields.io/aur/version/topgrade.svg)](https://aur.archlinux.org/packages/topgrade/)
2018-08-29 14:40:59 +03:00
![homebrew](https://img.shields.io/homebrew/v/topgrade.svg)
2018-05-31 16:27:23 +03:00
![Alt Text](doc/screenshot.gif)
Keeping your system up to date mostly involves invoking more than a single package manager. This
2018-06-10 11:23:44 +03:00
usually results in big shell one-liners saved in your shell history. Topgrade tries to solve this
2018-06-11 16:51:14 +03:00
problem by detecting which tools you use and run their appropriate package managers.
2018-05-31 16:27:23 +03:00
## Installation
2018-06-10 14:42:10 +03:00
Arch Linux users can use the [AUR](https://aur.archlinux.org/packages/topgrade/) package.
2018-08-29 11:43:44 +03:00
macOS users can install topgrade via Homebrew.
2018-09-05 11:23:04 +03:00
Other systems users can either use `cargo install` or use the compiled binaries from the release
page.
Topgrade isn't guaranteed to work on Rust versions older than the latest stable release. If you
intend to install Topgrade using Cargo then you should either install Rust using rustup or use a
distribution which ships the latest version of Rust, such as Arch Linux.
2018-05-31 16:27:23 +03:00
## Usage
2018-06-11 16:51:14 +03:00
Just run `topgrade`. It will run the following steps:
* Run the system package manager:
* *Arch*: Run [yay](https://github.com/Jguer/yay) or fall back to pacman
* *CentOS/RHEL*: Run `yum upgrade`
* *Fedora* - Run `dnf upgrade`
* *Debian/Ubuntu*: Run `apt update && apt dist-upgrade`
2018-06-28 09:01:27 +03:00
* *Unix*: Run `brew update && brew upgrade`. This should handle both Homebrew and Linuxbrew
2018-08-23 11:16:32 +03:00
* *Windows*: Upgrade Powershell modules
2018-06-28 09:01:27 +03:00
* *Windows*: Upgrade all [Chocolatey](https://chocolatey.org/) packages
2018-05-31 16:27:23 +03:00
* Check if the following paths are tracked by Git. If so, pull them:
* ~/.emacs.d (Should work whether you use [Spacemacs](http://spacemacs.org/) or a custom configuration)
* ~/.zshrc
* [~/.oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
* ~/.tmux
2018-07-05 20:46:05 +03:00
* ~/.config/fish
* ~/.config/nvim
* ~/.vim
2018-08-27 15:22:44 +03:00
* ~/.config/openbox
2018-08-23 22:08:04 +03:00
* Powershell Profile
* Custom defined paths
2018-06-11 16:51:14 +03:00
* *Unix*: Run [zplug](https://github.com/zplug/zplug) update
2018-07-03 14:31:25 +03:00
* *Unix*: Run [fisherman](https://github.com/fisherman/fisherman) update
2018-05-31 16:27:23 +03:00
* *Unix*: Upgrade tmux plugins with [TPM](https://github.com/tmux-plugins/tpm)
* Update Rustup by running `rustup update`. This will also attempt to run `rustup self update` when Rustup is installed inside the home directory.
2018-06-11 16:51:14 +03:00
* Run Cargo [install-update](https://github.com/nabijaczleweli/cargo-update)
2018-08-29 14:38:03 +03:00
* Upgrade Emacs packages (You'll get a better output if you have [Paradox](https://github.com/Malabarba/paradox) installed)
* Upgrade [OCaml packages](https://opam.ocaml.org/)
* Upgrade Vim/Neovim packages. Works with the following plugin frameworks:
2018-06-07 08:51:16 +03:00
* [NeoBundle](https://github.com/Shougo/neobundle.vim)
* [Vundle](https://github.com/VundleVim/Vundle.vim)
* [Plug](https://github.com/junegunn/vim-plug)
2018-06-06 11:29:55 +03:00
* Upgrade NPM globally installed packages
* Upgrade Atom packages
2018-06-14 13:24:52 +03:00
* *Linux*: Update Flatpak packages
* *Linux*: Update snap packages
2018-06-11 16:51:14 +03:00
* *Linux*: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View
only. No upgrades will actually be performed)
* Run custom defined commands
* Final stage
* *Linux*: Run [needrestart](https://github.com/liske/needrestart)
2018-08-23 11:16:32 +03:00
* *Windows*: Run Windows Update (You'll have to install [PSWindowsUpdate](https://marckean.com/2016/06/01/use-powershell-to-install-windows-updates/))
* *macOS*: Upgrade App Store applications
2018-06-20 21:05:49 +03:00
## Flags
* `-t/--tmux` - Topgrade will launch itself in a new tmux session. This flag has no effect if
Topgrade already runs inside tmux. This is useful when using topgrade on remote systems.
2018-08-27 13:17:27 +03:00
* `-n/--dry-run` - Print what should be run.
* `--no-system` - Skip the system upgrade phase.
2018-09-05 11:23:04 +03:00
* `--no-git-repos` - Don't pull custom git repositories.
* `--no-emacs` - Don't upgrade Emacs packages or configuration files.
2018-06-20 21:05:49 +03:00
## Customization
You can place a configuration file at `~/.config/topgrade.toml` (on macOS `~/Library/Preferences/topgrade.toml`).. Here's an example:
``` toml
git_repos = [
"~/dev/topgrade",
]
2018-06-20 20:26:08 +03:00
[pre_commands]
"Emacs Snapshot" = "rm -rf ~/.emacs.d/elpa.bak && cp -rl ~/.emacs.d/elpa ~/.emacs.d/elpa.bak"
[commands]
"Python Environment" = "~/dev/.env/bin/pip install -i https://pypi.python.org/simple -U --upgrade-strategy eager jupyter"
```
2018-06-20 20:26:08 +03:00
* `git_repos` - A list of custom Git repositories to pull
* `pre_commands` - Commands to execute before starting any action. If any command fails, Topgrade
will not proceed
* `commands` - Custom upgrade steps. If any command fails it will be reported in the summary as all
upgrade steps are reported, but it will not cause Topgrade to stop.