Release v0.4.0

This commit is contained in:
Ajeet D'Souza 2020-05-03 18:11:35 +05:30
parent 0e936fede1
commit 23eea59c70
4 changed files with 44 additions and 50 deletions

View File

@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased ## [0.4.0] - 2020-05-03
### Added ### Added
@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `$_ZO_ECHO` now only works when set to `1`. - `$_ZO_ECHO` now only works when set to `1`.
- Using the `--z-cmd` flag now also renames the associated aliases. - Using the `--z-cmd` flag now also renames the associated aliases.
- The `--z-cmd` flag has been renamed to `--cmd`. - The `--z-cmd` flag has been renamed to `--cmd`.
- The `--no-define-aliases` flag has been renamed to `--no-aliases`.
### Fixed ### Fixed
@ -120,6 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- GitHub Actions pipeline to build and upload releases. - GitHub Actions pipeline to build and upload releases.
- Support for the `zsh` shell. - Support for the `zsh` shell.
[0.4.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/ajeetdsouza/zoxide/compare/v0.3.0...v0.3.1 [0.3.1]: https://github.com/ajeetdsouza/zoxide/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.2...v0.3.0 [0.3.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.1...v0.2.2 [0.2.2]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.1...v0.2.2

2
Cargo.lock generated
View File

@ -430,7 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "zoxide" name = "zoxide"
version = "0.3.1" version = "0.4.0"
dependencies = [ dependencies = [
"anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", "anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,8 +1,8 @@
[package] [package]
name = "zoxide" name = "zoxide"
version = "0.3.1" version = "0.4.0"
authors = ["Ajeet D'Souza <98ajeet@gmail.com>"] authors = ["Ajeet D'Souza <98ajeet@gmail.com>"]
description = "A cd command that learns your habits" description = "A faster way to navigate your filesystem"
repository = "https://github.com/ajeetdsouza/zoxide/" repository = "https://github.com/ajeetdsouza/zoxide/"
edition = "2018" edition = "2018"

View File

@ -3,7 +3,7 @@
[![crates.io](https://img.shields.io/crates/v/zoxide)](https://crates.io/crates/zoxide) [![crates.io](https://img.shields.io/crates/v/zoxide)](https://crates.io/crates/zoxide)
![.github/workflows/release.yml](https://github.com/ajeetdsouza/zoxide/workflows/.github/workflows/release.yml/badge.svg) ![.github/workflows/release.yml](https://github.com/ajeetdsouza/zoxide/workflows/.github/workflows/release.yml/badge.svg)
A cd command that learns your habits A faster way to navigate your filesystem
## Table of contents ## Table of contents
@ -12,10 +12,10 @@ A cd command that learns your habits
- [Getting started](#getting-started) - [Getting started](#getting-started)
- [Installing `zoxide`](#step-1-installing-zoxide) - [Installing `zoxide`](#step-1-installing-zoxide)
- [Adding `zoxide` to your shell](#step-2-adding-zoxide-to-your-shell) - [Adding `zoxide` to your shell](#step-2-adding-zoxide-to-your-shell)
- [zsh](#zsh)
- [bash](#bash) - [bash](#bash)
- [fish](#fish) - [fish](#fish)
- [POSIX](#posix) - [POSIX](#posix-shells)
- [zsh](#zsh)
- [Configuration](#configuration) - [Configuration](#configuration)
- [`init` flags](#init-flags) - [`init` flags](#init-flags)
- [Environment variables](#environment-variables) - [Environment variables](#environment-variables)
@ -71,14 +71,6 @@ your existing database into `zoxide`:
zoxide import /path/to/db zoxide import /path/to/db
``` ```
#### zsh
Add the following line to your `~/.zshrc`:
```sh
eval "$(zoxide init zsh)"
```
#### bash #### bash
Add the following line to your `~/.bashrc`: Add the following line to your `~/.bashrc`:
@ -95,57 +87,57 @@ Add the following line to your `~/.config/fish/config.fish`:
zoxide init fish | source zoxide init fish | source
``` ```
#### POSIX #### POSIX shells
Add the following line to your shell's configuration file: Add the following line to your shell's configuration file:
```sh ```sh
eval "$(zoxide init posix)" eval "$(zoxide init posix --hook prompt)"
``` ```
NOTE: If you modify your `PS1` at any point, you may need to re-run the above command. This is due The `prompt` hook is recommended for POSIX shells because the default `pwd`
to the fact that the hook is stored in `PS1`, in order to be evaluated every time the prompt is hook creates a temporary file for every session, which are only deleted upon
displayed. reboot. If you do want to use `pwd` hooks instead, you may want to set up traps
to perform a cleanup once the shell exits:
NOTE: PWD hooks are currently not supported for POSIX shells. ```sh
trap '_zoxide_cleanup' EXIT HUP KILL TERM
trap '_zoxide_cleanup; trap - INT; kill -s INT "$$"' INT
trap '_zoxide_cleanup; trap - QUIT; kill -s QUIT "$$"' QUIT
```
NOTE: If you modify your `PS1` at any point, you may need to re-run the above
command. This is due to the fact that the hook is stored in `PS1`, in order to
be evaluated every time the prompt is displayed.
#### zsh
Add the following line to your `~/.zshrc`:
```sh
eval "$(zoxide init zsh)"
```
## Configuration ## Configuration
### `init` flags ### `init` flags
- `--hook <HOOK>`: change the event that adds a new entry to the database (default: `prompt`) - `--cmd`: change the `z` command (and corresponding aliases) to something else
- `none`: never add entries (this will make `zoxide` useless unless you manually configure a hook) - `--hook <HOOK>`: change the event that adds a new entry to the database
(default: `pwd`)
- `none`: never add entries
(this will make `zoxide` useless unless you manually configure a hook)
- `prompt`: add an entry at every prompt - `prompt`: add an entry at every prompt
- `pwd`: add an entry whenever you change directories - `pwd`: add an entry whenever the current directory is changed
- `--no-define-aliases`: don't define extra aliases like `zi`, `zq`, `za`, and `zr` - `--no-aliases`: don't define extra aliases like `zi`, `zq`, `za`, and `zr`
- `--z-cmd`: rename the `z` command to something else
### Environment variables ### Environment variables
- `$_ZO_DATA_DIR`: directory where `zoxide` will store its data files (default: - `$_ZO_DATA_DIR`: directory where `zoxide` will store its data files
platform-specific; see the [`dirs` documentation] for more information) (default: platform-specific; see the [`dirs` documentation] for more information)
- `$_ZO_ECHO`: `z` will print the matched directory before navigating to it - `$_ZO_ECHO`: when set to `1`, `z` will print the matched directory before navigating to it
- `$_ZO_EXCLUDE_DIRS`: list of directories separated by platform-specific - `$_ZO_EXCLUDE_DIRS`: list of directories separated by platform-specific characters
characters ("`:`" on Linux and macOS, and "`;`" on Windows) to be excluded from ("`:`" on Linux/macOS, "`;`" on Windows) to be excluded from the database
the database
- `$_ZO_MAXAGE`: sets the maximum total rank after which entries start getting deleted - `$_ZO_MAXAGE`: sets the maximum total rank after which entries start getting deleted
[`dirs` documentation]: https://docs.rs/dirs/latest/dirs/fn.data_local_dir.html [`dirs` documentation]: https://docs.rs/dirs/latest/dirs/fn.data_local_dir.html
## Notes
If you recently updated `zoxide` from an older version to `v0.3` and are
seeing the following error:
```
Error: could not deserialize old database
Caused by:
io error: failed to fill whole buffer
```
It is because v0.2 and v0.3 databases are incompatible. There is a script to
automatically migrate your database to the new format, but it seems to be
failing on some systems.
For a quick fix, you can try removing the old database file: `rm ~/.zo`