Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message if working-directory does not exist #2295

Open
nyurik opened this issue Aug 2, 2024 · 3 comments
Open

Improve error message if working-directory does not exist #2295

nyurik opened this issue Aug 2, 2024 · 3 comments

Comments

@nyurik
Copy link
Contributor

nyurik commented Aug 2, 2024

For justfiles that override working-directory value, if the dir does not exist, just gives a rather criptic message:

set working-directory := 'missing'

[no-cd]
bar:
  pwd   # this one will work fine

foo:
  pwd   # this one will not even start if 'missing' dir is missing
error: Recipe ... could not be run because just could not find 
the shell: No such file or directory (os error 2)
@casey
Copy link
Owner

casey commented Aug 2, 2024

I think the best way to fix this is, when running a command, if it returns an error and that error is file not found, check if the working directory exists and if it does not, transform the error into a more specific error about the working directory not existing.

@tritao
Copy link

tritao commented Aug 12, 2024

Was hit by this yesterday and the current error message was definitely confusing.

artm added a commit to artm/just that referenced this issue Aug 24, 2024
Handles two cases:

- working directory doesn't exist.
- working directory cannot be changed into due to on of the following:
    - The process lacks permissions to view the contents.
    - The path points at a non-directory file.

Addresses: casey#2295
@artm
Copy link

artm commented Aug 24, 2024

The same problem would happen if the working directory was a file or couldn't be changed to due to lack of permissions, so I tackled all possibilities at once.

artm added a commit to artm/just that referenced this issue Sep 1, 2024
Handles two cases:

- working directory doesn't exist.
- working directory cannot be changed into due to on of the following:
    - The process lacks permissions to view the contents.
    - The path points at a non-directory file.

Addresses: casey#2295
artm added a commit to artm/just that referenced this issue Sep 1, 2024
Handles two cases:

- working directory doesn't exist.
- working directory cannot be changed into due to on of the following:
    - The process lacks permissions to view the contents.
    - The path points at a non-directory file.

Addresses: casey#2295
artm added a commit to artm/just that referenced this issue Sep 11, 2024
Handles two cases:

- working directory doesn't exist.
- working directory cannot be changed into due to on of the following:
    - The process lacks permissions to view the contents.
    - The path points at a non-directory file.

Addresses: casey#2295
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants