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

Added macOS compatibility #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Zhann
Copy link

@Zhann Zhann commented Feb 25, 2021

Ensures this script works with macOS by leveraging gnu-sed versus freeBSD sed when on macOS.

Also updated README to show macOS specific installation instructions.

@Bugswriter
Copy link
Owner

Bugswriter commented Feb 25, 2021

umm I thought someone already did that. Is tuxi is not running on mac?

@sdushantha
Copy link
Contributor

I tested tuxi on macOS and I can confirm that it does not work properly on macOS. sed seems to be throwing errors because it is missing a few features which the GNU version of sed has.
This can be seen in the output below:

$ tuxi unix time       
sed: 1: ":a;N;$!ba;s/\n/ /g": unused label 'a;N;$!ba;s/\n/ /g'
sed: 1: ":a;N;$!ba;s/\n/ /g;s/nu ...": unused label 'a;N;$!ba;s/\n/ /g;s/null/\n/g'
usage: paste [-s] [-d delimiters] file ...
---
Unix time is a system for describing a point in
time. It is the number of seconds that have elapsed
since the Unix epoch, minus leap seconds; the Unix epoch
is 00:00:00 UTC on 1 January 1970; leap ...
---

Since we added the "Learn to pronounce" scraper in #152, we can see that the paste command throws an error as well. This can easily be fixed by using gpaste if the user is using macOS.

@Zhann Zhann force-pushed the macos-compatibility branch from e1a0e6e to a87ac6b Compare February 26, 2021 13:19
@Zhann
Copy link
Author

Zhann commented Feb 26, 2021

Rebased and did the same for (g)paste:

❯ tuxi unix time
---
Unix time is a system for describing a point in
time. It is the number of seconds that have elapsed
since the Unix epoch, minus leap seconds; the Unix epoch
is 00:00:00 UTC on 1 January 1970; leap ...
---

@BeyondMagic
Copy link
Contributor

@Zhann remove the bashisms

@Zhann
Copy link
Author

Zhann commented Feb 28, 2021

@Zhann remove the bashisms

What does that mean? You mean the curly braces? :-)

@BeyondMagic
Copy link
Contributor

What does that mean? You mean the curly braces? :-)

Yes, I sent a PR there.

https://mywiki.wooledge.org/Bashism

Bugswriter added a commit that referenced this pull request Mar 1, 2021
added pronounce snippet from #152 and macOS compatibility from #149
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

Successfully merging this pull request may close these issues.

4 participants