Skip to content

Commit 3710fb2

Browse files
authoredMay 11, 2019
Android os (#13)
* update readme file * support andorid OS support to configure data folder * add switch OS configuration steps to README
1 parent daae0ae commit 3710fb2

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed
 

‎README.md

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ brew tap isacikgoz/taps
3030
brew install isacikgoz/taps/tldr
3131
```
3232

33+
## Use for different OS
34+
You can use tldr++ for another OS by setting `TLDR_OS` envrionment to your desired OS such as `linux`, `windows`, `osx` etc.
35+
36+
Let's say you want to set it to Linux run the following command:
37+
38+
```bash
39+
export TLDR_OS=linux
40+
```
41+
42+
To make it permenant, you can add the line above to your shell rc file (e.g. `bashrc`, `zshrc` etc.)
43+
3344
## Credits
3445
- [tldr-pages](https://github.com/tldr-pages/tldr)
3546
- [survey](https://github.com/AlecAivazis/survey)

‎main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020

2121
func main() {
2222

23-
kingpin.Version("tldr++ version 0.6.0")
23+
kingpin.Version("tldr++ version 0.6.1")
2424
kingpin.Parse()
2525

2626
config.StartUp(*clear, *update)

‎pkg/config/source.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,15 @@ func PullSource() error {
6767
return err
6868
}
6969

70-
// returns OS dependent data dir. see XDG Base Directory Specification:
70+
// DataDir returns OS dependent data dir. see XDG Base Directory Specification:
7171
// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
7272
func DataDir() (d string) {
7373
switch osname := runtime.GOOS; osname {
7474
case "windows":
7575
d = os.Getenv("APPDATA")
7676
case "darwin":
7777
d = os.Getenv("HOME") + "/Library/Application Support"
78-
case "linux":
79-
d = os.Getenv("HOME") + "/.local/share"
80-
case "solaris":
78+
case "linux", "android", "solaris":
8179
d = os.Getenv("HOME") + "/.local/share"
8280
default:
8381
fmt.Println("Operating system couldn't be recognized")

0 commit comments

Comments
 (0)
Please sign in to comment.