jmacdotorg / sweat

Sweat - A chatty, distracting, and flexible workout timer.
MIT License
11 stars 2 forks source link

Getting uninitialized value $program in split while running sweat #5

Closed rai-gaurav closed 4 years ago

rai-gaurav commented 4 years ago

I really like the ides and hence tried to give it a try. After installation while running 'sweat' -

$ sweat
Use of uninitialized value $program in split at /usr/local/share/perl/5.22.1/Sweat.pm line 264.
Use of uninitialized value $program in concatenation (.) or string at /usr/local/share/perl/5.22.1/Sweat.pm line 267.
WARNING: Sweat's 'url-program' configuration is set to '', but there doesn't seem to be a program there. Going ahead without url-opening.
WARNING: Sweat's 'fortune-program' configuration is set to 'fortune', but there doesn't seem to be a program there. Going ahead without fortune-opening.
Loading entertainment, please wait...
Sweat ran into a problem fetching Wikipedia articles: Can't use an undefined value as a HASH reference at /usr/local/share/perl/5.22.1/Sweat/Article.pm line 116.

Giving --shuffle and --entertainment param gave the same error. However this command runs fine -

$ sweat --no-entertainment
Prepare for jumping jacks. Drill 1.
10 seconds left.
5
4
3
2
1
Start now. 
30 seconds left.
20 seconds.

Perl - 5.22.1 OS - Ubuntu

I hope I am running the program correctly.

rai-gaurav commented 4 years ago

Wikipedia issue generated above is because of no internet. After providing internet

$ sweat
Use of uninitialized value $program in split at /usr/local/share/perl/5.22.1/Sweat.pm line 264.
Use of uninitialized value $program in concatenation (.) or string at /usr/local/share/perl/5.22.1/Sweat.pm line 267.
WARNING: Sweat's 'url-program' configuration is set to '', but there doesn't seem to be a program there. Going ahead without url-opening.
WARNING: Sweat's 'fortune-program' configuration is set to 'fortune', but there doesn't seem to be a program there. Going ahead without fortune-opening.
Loading entertainment, please wait...
...done.
Prepare for jumping jacks. Drill 1.
10 seconds left.
5
4
3
2
1

The error handling can be little better.

jmacdotorg commented 4 years ago

Thanks for this!

The latter issue is one I'm recently aware of through my own use, and I intend to fix it presently.

The former I had not noticed! That's a good catch and I'll see what I can do it fix it up.

jmacdotorg commented 4 years ago

Fixed in 3333af2ef57253d63009a7ebaa5c11e9d2004dec. Thank you!