From 3710fb21c56749a0a1bf7346e27e62c23b4c508d Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Sat, 11 May 2019 14:27:51 +0300 Subject: [PATCH] Android os (#13) * update readme file * support andorid OS support to configure data folder * add switch OS configuration steps to README --- README.md | 11 +++++++++++ main.go | 2 +- pkg/config/source.go | 6 ++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0208697..1620e95 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,17 @@ brew tap isacikgoz/taps brew install isacikgoz/taps/tldr ``` +## Use for different OS +You can use tldr++ for another OS by setting `TLDR_OS` envrionment to your desired OS such as `linux`, `windows`, `osx` etc. + +Let's say you want to set it to Linux run the following command: + +```bash +export TLDR_OS=linux +``` + +To make it permenant, you can add the line above to your shell rc file (e.g. `bashrc`, `zshrc` etc.) + ## Credits - [tldr-pages](https://github.com/tldr-pages/tldr) - [survey](https://github.com/AlecAivazis/survey) diff --git a/main.go b/main.go index 1a14f03..f1fb2ce 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ var ( func main() { - kingpin.Version("tldr++ version 0.6.0") + kingpin.Version("tldr++ version 0.6.1") kingpin.Parse() config.StartUp(*clear, *update) diff --git a/pkg/config/source.go b/pkg/config/source.go index 28591c6..0654f5a 100644 --- a/pkg/config/source.go +++ b/pkg/config/source.go @@ -67,7 +67,7 @@ func PullSource() error { return err } -// returns OS dependent data dir. see XDG Base Directory Specification: +// DataDir returns OS dependent data dir. see XDG Base Directory Specification: // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html func DataDir() (d string) { switch osname := runtime.GOOS; osname { @@ -75,9 +75,7 @@ func DataDir() (d string) { d = os.Getenv("APPDATA") case "darwin": d = os.Getenv("HOME") + "/Library/Application Support" - case "linux": - d = os.Getenv("HOME") + "/.local/share" - case "solaris": + case "linux", "android", "solaris": d = os.Getenv("HOME") + "/.local/share" default: fmt.Println("Operating system couldn't be recognized")