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

Can't find java #18

Open
marchchad opened this issue Dec 21, 2023 · 6 comments
Open

Can't find java #18

marchchad opened this issue Dec 21, 2023 · 6 comments

Comments

@marchchad
Copy link

Just installed this extension on Windows using WSL2 and noticed it wasn't loading. I found the output for the extension and saw these errors logged.

[2023-12-21 18:23:02.696] [INFO]: GitHooks extension is now active!
[2023-12-21 18:23:02.960] [INFO]: hooksPathArray [object Promise],[object Promise],[object Promise],[object Promise],[object Promise],[object Promise],[object Promise]
[2023-12-21 18:23:03.750] [ERROR]: Unable to read or locate hooksDirectory failed with following error : 
 Error: No valid git hook directories found
[2023-12-21 18:23:03.751] [ERROR]: Failed to execute shell command: which java. Error: Error: Command failed: which java

[2023-12-21 18:23:03.751] [WARN]: unable to detect java launguage path

Nowhere in the extension overview does it say java is a dependency.

@Lakshmikanth2001
Copy link
Owner

Lakshmikanth2001 commented Dec 21, 2023

Its just a warning, git hooks can be written in any language for giving shell path suggestion, we are executing which java command, may be that user doest have read and write permissions for hook directory, because there is an error reading the hook•directory

@Lakshmikanth2001
Copy link
Owner

Greetings any update on this issue

@marchchad
Copy link
Author

I gave up on using the extension and uninstalled it.

@Lakshmikanth2001
Copy link
Owner

Lakshmikanth2001 commented Mar 8, 2024

Sorry to hear that 🥲, if you can provide more details about your hookDir permissions we can resolve the issue or

It's okay thank you for raising the issue and sorry I am unable to solve it

if you are no longer interested in using it please feel free to close the issue thank you 🙂

@marchchad
Copy link
Author

Yeah no problem. Here's the perms for my .git/hooks dir for the repo I was trying to use this extension for:

cmarch@PC889:~/repos/<redacted>$ ls -lha .git/
total 196K
drwxr-xr-x   8 cmarch cmarch 4.0K Mar  8 10:59 .
drwxr-xr-x  14 cmarch cmarch 4.0K Mar  7 15:42 ..
-rw-r--r--   1 cmarch cmarch   52 Mar  7 15:45 COMMIT_EDITMSG
-rw-r--r--   1 cmarch cmarch  125 Mar  8 11:12 FETCH_HEAD
-rw-r--r--   1 cmarch cmarch   46 Mar  8 10:59 HEAD
-rw-r--r--   1 cmarch cmarch   41 Mar  7 16:17 ORIG_HEAD
drwxr-xr-x   2 cmarch cmarch 4.0K May 11  2023 branches
-rw-r--r--   1 cmarch cmarch  11K Mar  8 10:24 config
-rw-r--r--   1 cmarch cmarch   73 May 11  2023 description
drwxr-xr-x   2 cmarch cmarch 4.0K Dec 21 11:15 hooks
-rw-r--r--   1 cmarch cmarch 101K Mar  8 10:59 index
drwxr-xr-x   2 cmarch cmarch 4.0K Feb 21 11:48 info
drwxr-xr-x   3 cmarch cmarch 4.0K Feb 21 11:48 logs
drwxr-xr-x 257 cmarch cmarch 4.0K Mar  8 11:12 objects
-rw-r--r--   1 cmarch cmarch  26K Feb 21 11:48 packed-refs
drwxr-xr-x   5 cmarch cmarch 4.0K Feb 21 11:48 refs

I do have interest in getting this to work, I just haven't had the time to solve it on my own.

@Lakshmikanth2001
Copy link
Owner

your hooks directory looks

  • I will try to replicate this issue on wsl VM which I have, and would you like to share your git version because git > 2.41 has a command to run hooks directly with git hook run <hook-name>

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

2 participants