Commit Graph

6 Commits

Author SHA1 Message Date
Cole Helbling ee8f3427d1
Migrate from `z` database
The new `migrate` function takes in a path to the old `z` database and
naively parses it to add to the database. It sets the epoch to be the
current time in order to prevent scaling down old directories from the
`z` database -- at least until `zoxide` is up and running.

The program will fail if the user already has a database, so as to
prevent tainting it in any way. It will also fail if the database is not
in the expected format -- e.g. if it doesn't follow the
`/path/to/somewhere|1.0101|10101010101` schema. The way this is
validated is by looking for 2 pipe characters and erroring if there is
only 1 (`first_pipe_idx == last_pipe_idx`). It will ignore any dead
paths if the user has not cleaned their database recently.
2020-03-12 12:01:44 -07:00
Ajeet D'Souza 65b37082b6 Add DB save to Drop trait 2020-03-12 23:07:50 +05:30
Ajeet D'Souza f0c5e28fd7 * Add init subcommand for bash, fish, and zsh
* Migrate errors from failure to anyhow
* Migrate argument parsing from clap to structopt
* Empty z command now goes to $HOME
* DB updates are now atomic and isolated
2020-03-11 00:14:50 +05:30
Ajeet D'Souza 32ed84c27e Add README 2020-03-08 08:14:54 +05:30
Ajeet D'Souza 784ed10aad Add aging algorithm 2020-03-06 23:13:32 +05:30
Ajeet D'Souza 68a426216d Initial commit 2020-03-05 20:06:58 +05:30