Commit Graph

27 Commits

Author SHA1 Message Date
Jason Shirk 3c087c0f8d PR feedback 2020-04-09 11:34:17 -07:00
Jason Shirk 55825f6082 Use dunce to canonicalize paths 2020-04-08 23:19:52 -07:00
Jason Shirk 0aeba8d09b Remove Windows verbatim drive in path
`canonicalize` replaces the drive in a path with verbatim syntax,
e.g. `C:\Windows` turns into `\\?\C:\Windows`.

While Win32 apis handle verbatim paths nicely, commonly used Windows
shells like PowerShell and cmd do not, so we remove the prefix
before adding any paths to the database.
2020-04-08 21:50:01 -07:00
Ajeet D'Souza 56218f35d3 Interactive mode for `zoxide remove` 2020-04-06 08:41:28 +05:30
Ajeet D'Souza 2f73465d8d Saving DB should clear the modified flag 2020-04-05 21:39:21 +05:30
Ajeet D'Souza 342954cda0 Performance improvements 2020-04-05 20:44:23 +05:30
Ajeet D'Souza 9d0222383f Style nits 2020-03-30 06:49:41 +05:30
Ajeet D'Souza 3c7d100ab1 Guarantee unique file names for temporary database 2020-03-30 03:32:21 +05:30
Ajeet D'Souza 78a3d0a3d9 Remove indoc dependency 2020-03-30 03:32:21 +05:30
Cole Helbling 9af0251bd6 Rework database fallback for v0.3 (#47)
Support migration from old database
2020-03-30 03:32:21 +05:30
Ajeet D'Souza d4c8297f9b Use UUID4 for temporary database file name 2020-03-30 03:32:21 +05:30
Ajeet D'Souza 057ed96c0a Refactor DB architecture 2020-03-30 03:32:21 +05:30
Ajeet D'Souza f29b642ffc Remove FIXME 2020-03-30 03:32:21 +05:30
Ajeet D'Souza d4fb1a05cf Manually parse environment variables 2020-03-30 03:32:21 +05:30
Ajeet D'Souza 5547fb4b80 Rename `migrate` command to `import` 2020-03-30 03:31:22 +05:30
Ajeet D'Souza 76dfaad9a1 Set max DB size to 8 MiB 2020-03-30 03:30:12 +05:30
Ajeet D'Souza 890185176e Store paths as PathBuf rather than String 2020-03-30 03:30:12 +05:30
Ajeet D'Souza b3470de799 Remove flock 2020-03-17 13:05:10 +05:30
Cole Helbling 083a834310
Allow merging when migrating from `z` (#33)
If the user passes the `--merge` flag to the `migrate` subcommand, all
duplicate entries will have their ranks and epochs updated: the rank
will be the sum of the stored rank and the newly-parsed rank, while the
epoch will be the maximum of the stored epoch and the newly-parsed
epoch.

This allows one to import from the `z` database even after having used
`zoxide` for any amount of time. This also permits a user who has
already sourced the init script to import their old database without
needing to do something like `rm ~/.zo && zoxide migrate ~/.z`.
2020-03-15 23:48:59 +05:30
Ajeet D'Souza eb21727868 Use envy to parse environment variables 2020-03-13 14:12:20 +05:30
Ajeet D'Souza 9c8e8da71a Refactor + support PWD hook for zsh 2020-03-13 06:19:37 +05:30
Cole Helbling 4596716cc8
Migrate from `z` database (#29)
Migrate from `z` database

The new `migrate` subcommand takes in a path to the old `z` database and
naively parses it to add to the database. The command will fail if the user already has a database, so as to prevent tainting it in any way.
2020-03-13 05:15:06 +05:30
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