-
Notifications
You must be signed in to change notification settings - Fork 137
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
Prevent errors when both env WAKATIME_HOME and HOME are not set #238
Conversation
What's the error message you see without this fix? Is the error coming from wakatime-cli or from vscode? |
if Dependencies.getHomeDirectory() returns '', wakatime is installed at './.wakatime'
yes, error is coming from wakatime-cli: {
"caller":"/Users/runner/work/wakatime-cli/wakatime-cli/cmd/legacy/run.go:194",
"func":"runCmd",
"level":"error",
"message":"failed to run command: sending heartbeat(s) failed: failed to load offline queue filepath: failed getting user's home directory: $HOME is not defined",
"now":"2021-09-17T03:48:04Z",
"version":"v1.26.0"
} but this fix will also be needed because wakatime is installed in cwd |
That error comes from: I think we should fallback to an alternate way of detecting When testing, the legacy Python wakatime-cli works without |
ok, Come to think of it, This is not a problem to be solved here Thank you for solving this problem! |
Fixed with wakatime/wakatime-cli#547. |
Does it work now with v1.26.1 of wakatime-cli? |
@alanhamlett in wakatime vsc plugin, if env HOME and WAKATIME_HOME are not defined, config file and wakatime are installed at vsc pwd. I think it will be solved by changing this to refer to PWD, or change the constant return value of following function to user home directory: vscode-wakatime/src/dependencies.ts Lines 65 to 70 in 9225d77
Thank you for your kindness! |
We're now defaulting to CWD in vscode when |
In a special case where environment variables cannot be set at will, wakatime may not be executed because even env HOME is not set.
Even if the file location is set in the argument, it cannot be executed because wakatime-cli refers to the env HOME.
This Pull Request adds a code for setting an environment variable when it is not set.
After this commit, It will be able to run smoothly even in special environment like online vscode.