From e1a0e6e0d333845c64ae1bab2d2b1f0776006393 Mon Sep 17 00:00:00 2001 From: Steven De Coeyer Date: Thu, 25 Feb 2021 05:14:49 +0100 Subject: [PATCH] Added macOS compatibility --- README.md | 12 ++++++++++++ tuxi | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 0c2a5b6..7e9ff97 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ to process and return results, and `recode` to unescape html. * [recode](https://github.com/rrthomas/recode) - Charset converter tool and library. * [jq](https://github.com/stedolan/jq) - Command-line JSON processor. +### macOS specific requirements + +* [gnu-sed](https://www.gnu.org/software/sed/) - sed (stream editor) is a non-interactive command-line text editor + ## Installation ### cURL @@ -50,6 +54,14 @@ Tuxi is available as the [`tuxi-git`](https://aur.archlinux.org/packages/tuxi-gi $ yay -S tuxi-git ``` +### macOS +Tuxi dependencies are available as [`brew`](https://brew.sh) Formulae. cURL **tuxi** to your **$PATH** and give execute permissions. +```sh +brew install pup recode gnu-sed +sudo curl -sL "https://raw.githubusercontent.com/Bugswriter/tuxi/main/tuxi" -o /usr/local/bin/tuxi +sudo chmod +x /usr/local/bin/tuxi +``` + ## Usage ```sh diff --git a/tuxi b/tuxi index b72fbdb..829a063 100755 --- a/tuxi +++ b/tuxi @@ -11,6 +11,14 @@ LANGUAGE="" ##### Functions ##### ############################### +sed () { + if [[ "$OSTYPE" == "darwin"* ]]; then + gsed "${@}" + else + sed "${@}" + fi +} + help_text () { printf "%bUsage:%b tuxi %b[options]%b %bquery%b\n" "$G" "$N" "$Y" "$N" "$M" "$N" printf "\n"