-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: ignored TWT_TOKEN env variable #592
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #592 +/- ##
=======================================
Coverage 19.26% 19.26%
=======================================
Files 41 41
Lines 5086 5086
=======================================
Hits 980 980
Misses 4106 4106 ☔ View full report in Codecov by Sentry. |
Hi! Thanks for the PR. Don't worry about the failing CI on formatting, I'll be testing this just on functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really seeing what your diff does to fix the bug that you were experiencing. You changed the control flow a little bit, but the logic for checking and setting the environment variable is done before the changes you made.
The section that you did change deals with the error handling, but not any actual writing to the token environment variable that is used to log into the IRC at config.twitch.token
.
Perhaps it's something to do with exporting TWT_TOKEN
on your system. What shell are you using, and how are you setting the environment variable? I am unable to reproduce via export "<token>" && twt
.
Hi,
I don't think the error is relative to a shell, as I got the same result from bash or zsh on Arch. Here is the part of my script I am trying to run. The streamlink -Q "--twitch-api-header=Authorization=Bearer $ACCESSTOKEN" https://www.twitch.tv/$selected_channel &
TWT_TOKEN="oauth:$ACCESSTOKEN" twt -c $selected_channel Let me do some recheck. It's weird. |
I also tried |
What version of twitch-tui are you on? I tried the same command as yours with my token, seemed to work fine. |
I'm using twitch-tui 2.6.7 and rust 1.78.0. I did a fresh install on a different machine (Macbook) and I've got the same issue. Fun story, and that's why I thought my PR fix the issue, when I run from the source, it works totally fine
but if I run it with the binary, the environment variable is ignored. :mindblowing:
|
Do the changes in this PR fix the issue you're experiencing? |
I updated the PR and changed the way the code get the variable, and everything seems fine now. |
Ah, yeah that might just fix it. I'll test it very soon. I have a feeling it's to do with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried a bunch of different ways to set the environment variable, I haven't had any problems with the current state of this PR.
I'll get out a version such that the hotfix is available.
Thank you!
Hi !
Discovered this tool yesterday. I wondered why I can't pass TWT_TOKEN env variable to the CLI. It seems the variable is ignored.
I made this fix. It should deserve a test, but I don't know Rust so much.