jamesob / jamesob/desk

Desk init does not work when using a custom location

Open
#93 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
2.6k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

This _might_ be related to #34, somewhat, but considering the last activity on that thread was years ago, I instead decided to simply make another issue thread for this.

If I run `desk init` and set everything as default, everything works. However, if I try to set a different default location for `.desk`, it does not work and displays `No desk dir! Run 'desk init'.`

I'm not really doing anything fancy, so I don't really understand why it is not working. I'm sourcing the completions from the `shell_plugins\bash\desk` and I've set desk to an alias for ease of use. My bash version is 4.4.23(1)-release, as can be seen in the picture below.

![image](https://user-images.githubusercontent.com/3003484/120890352-7039c300-c602-11eb-9940-9dd0b71a8bc1.png)

The activation hook is added to the EOF in .bashrc, and I've even tried setting `DESK_DIR` and `DESK_DESKS_DIR` to their correct path and tested the output, I can `cd` to them just fine, but trying to run something like `desk list` immediately afterwards still makes it complain about `No desk dir! Run 'desk init'.`

Currently the environment variables are set to:
```
DESK_DIR='H:/.user/.desk'
DESK_DESKS_DIR='H:/.user/.desk/desks'
```

For clarity, it does not work even if the environment variables are not set.

When running something like `desk go ` it outputs this:
```
❯ desk go rtest
Desk rtest (rtest.sh) not found in /h//.desk/desks
```

So at least I know it is still checking in the default location, for some reason.

Testing with an absolute path results in the same.
```
❯ desk go /h/.user/.desk/desks/rtest
Desk /h/.user/.desk/desks/rtest (/h/.user/.desk/desks/rtest.sh) not found in /h//.desk/desks
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the initialization and lookup flow from shell_plugins/bash/desk, then compare how DESK_DIR and DESK_DESKS_DIR are read when running desk list or desk go. Reproduce the issue with the custom paths shown in the report and verify that those commands use the configured location instead of /h//.desk/desks.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.