Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Added macOS compatibility#149

Open
Zhann wants to merge 1 commit intobugswriter:mainfrom
Zhann:macos-compatibility
Open

Added macOS compatibility#149
Zhann wants to merge 1 commit intobugswriter:mainfrom
Zhann:macos-compatibility

Conversation

@Zhann
Copy link
Copy Markdown

@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
Copy Markdown
Owner

bugswriter commented Feb 25, 2021

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

@sdushantha
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@Zhann remove the bashisms

@Zhann
Copy link
Copy Markdown
Author

Zhann commented Feb 28, 2021

@Zhann remove the bashisms

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

@BeyondMagic
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants