Comments (6)
Firstly, @iDCoded, I must apologise for crashing your issue. Your question was:
Is there anything I can do to add the location of a directory to ZLocation
An answer to this is to change to the directory, then run Update-ZLocation $PWD
. This should add the current directory. Or you could pass in any directory instead of $PWD
.
If this does not work, you probably have some other problem going on. Seeing as you already have plenty of other items in your history, could it be something you installed recently? Is your problem only showing up on this specific directory or all?
As for my issue, after a lot of hair pulling and eventually commenting out each thing in my profile, the weirdness was down to this line:
Set-Alias find fd
I had overridden find.exe
with fd (possibly not the best idea in hindsight, especially as typing 'fd' is two characters easier 😆).
I suspect (not sure) this lead to a clash with:
ZLocation/ZLocation/ZLocation.LiteDB.psm1
Lines 30 to 38 in 982799a
from zlocation.
@charlesroper I have tried that and it successfully worked the way it was intended.
Thanks a bunch for your assistance, I will now be closing this issue :).
from zlocation.
I have a similar problem. I have just installed ZLocation and this is what the straight z
command gives me:
[ pwsh] ~
➜ z
Weight Path
------ ----
0 ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
0 ::{645FF040-5081-101B-9F08-00AA002F954E}
0 C:\inetpub
0 C:\Users\Charles
0 C:\Users\Charles\Desktop
0 C:\Users\Charles\Dev
0 C:\Users\Charles\Downloads
0 C:\Users\Charles\OneDrive\Music
I'm not sure why it has these particular directories in the database.
If I cd to a few different directories, they do not seem to be getting added to the db.
[ pwsh] ~
➜ z
Weight Path
------ ----
0 ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
0 ::{645FF040-5081-101B-9F08-00AA002F954E}
0 C:\inetpub
0 C:\Users\Charles
0 C:\Users\Charles\Desktop
0 C:\Users\Charles\Dev
0 C:\Users\Charles\Downloads
0 C:\Users\Charles\OneDrive\Music
[ pwsh] ~
➜ cd .\Dev\JavaScript\
[ pwsh] ~\..\JavaScript
➜ z
Weight Path
------ ----
0 ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
0 ::{645FF040-5081-101B-9F08-00AA002F954E}
0 C:\inetpub
0 C:\Users\Charles
0 C:\Users\Charles\Desktop
0 C:\Users\Charles\Dev
0 C:\Users\Charles\Downloads
0 C:\Users\Charles\OneDrive\Music
[ pwsh] ~\..\JavaScript
➜ cd -
[ pwsh] ~
➜ z JavaScript
WARNING: Cannot find matching location
Not sure if I've done something dumb or if there's a genuine problem. The z-location.db
file does not seem to be getting updated when I cd around - timestamp and size stay the same.
from zlocation.
Further to this, I just tried uninstalling (and deleting the z-location.db file) and reinstalling. This time I saw this:
[ pwsh] ~
➜ Install-Module ZLocation -Scope CurrentUser; Import-Module ZLocation;
[fd error]: Search path '(_id = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D})' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\Users\\Charles)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\Users\\Charles\\Dev)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\inetpub)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = ::{645FF040-5081-101B-9F08-00AA002F954E})' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\Users\\Charles\\Downloads)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\Users\\Charles\\OneDrive\\Music)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
[fd error]: Search path '(_id = C:\\Users\\Charles\\Desktop)' is not a directory.
[fd error]: Search path 'Location' is not a directory.
[fd error]: No valid search paths given.
from zlocation.
ZLocation
does edit the function:\prompt
so maybe there is something weird going on. You just need to add Update-ZLocation $PWD
to the aforementioned function. Additionally, by default ZLocation
adds your Quick Access Frequent Folders so maybe there is something going on there too?
from zlocation.
An answer to this is to change to the directory, then run Update-ZLocation $PWD. This should add the current directory. Or you could pass in any directory instead of $PWD.
I'll try this and update if the issue continues.
from zlocation.
Related Issues (20)
- It would be great to see a list of most recent HOT 2
- [Feature Request] Allow installation via Chocolatey
- Set-ZLocation and Update-ZLocation break for PS 7 if the user has defined an alias for 'find' HOT 1
- How to exclude a directory from tracking? HOT 1
- Exception calling "Add" with "2" argument(s) - issue after updating powershell to 7.1 HOT 2
- [Feature Request] z partial/path/to/dir? HOT 1
- Doesn't work with posh-git's error reporting (DollarQuestion) HOT 3
- how can I unsinstall it?thanks. HOT 1
- Database has duplicate entries differing in case only
- Cannot z to network drives HOT 1
- Invoke-ZLocation doesn't work with oh-my-posh + posh-git + ZLocation HOT 2
- Question: possible to prefer child directories? HOT 1
- [Feature request] only display directories with tab completion HOT 5
- Duplicate Unc Paths in Database Where Only One Is Updated
- profile file flood
- Can't jump a folder with `[` or `]` in it
- Get-FrequentFolders in ssh session is very slow HOT 3
- Unable to uninstall Zlocation HOT 1
- Path resolution is not picking the best option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zlocation.