5 Commits
Author SHA1 Message Date
Yash-Handa f6f6bee415 minor fixes 2020-09-16 20:01:48 +05:30
Yash-Handa 8be883a8de Added go get and Build from Source to README.md 2020-09-16 18:05:24 +05:30
Yash-Handa 3548235135 fixed a bug on list of very long file names 2020-09-16 17:16:33 +05:30
Yash-Handa e7baa8cbbd Added go.mod to .github dir 2020-09-16 13:47:41 +05:30
Yash-Handa 916334088e bumped up version to 1.3.4 2020-09-10 15:13:51 +05:30
24 changed files with 78 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
// An empty go.mod file to refrain this dir to be distributed with the cli tool
Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 KiB

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 KiB

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 50 KiB

+1 -1
View File
@@ -2,7 +2,7 @@
# Make sure to check the documentation at http://goreleaser.com
env_files:
github_token: '{{ .Env.PWD }}.gh_token'
github_token: ~/Projects/Golang_Stuff/logo-ls/.gh_token
project_name: logo-ls
+64 -1
View File
@@ -48,6 +48,8 @@ Command and Arguments supported are listed in [HELP.md](/HELP.md)
- [Red Hat (.rpm package)](#red-hat-rpm-package)
- [MacOS (Darwin)](#macos-darwin)
- [Linux](#linux)
- [go get](#go-get)
- [Build from Source](#build-from-source)
- [Check the downloaded Resource](#check-the-downloaded-resource)
- [Recommended configurations](#recommended-configurations)
- [Updating](#updating)
@@ -318,9 +320,70 @@ If you want the man page of `logo-ls` place `logo-ls.1.gz` in `/usr/share/man/ma
$ sudo cp logo-ls.1.gz /usr/share/man/man1/
```
### go get
If you have [Golang](https://golang.org/) installed on your system then the `logo-ls` can be downloaded and installed using the the `go` cli tool provided by the language
#### Step 1
The `go` cli installs the binary in the directory specified by `$GOBIN` env variable [default: `~/go/bin/`]. In order to call `logo-ls` from anywhere in user-space, this directory which holds the binary must be present in `$PATH` env variable.
```cmd
$ echo $PATH
```
#### Step 2
Now simply install the binary using `go get` in home directory
```cmd
$ cd ~
$ go get github.com/Yash-Handa/logo-ls
```
### Build from Source
It is quite simple to build the command from source. You should have [Golang](https://golang.org/) installed on your system.
#### Step 1
Clone this repository.
```cmd
$ git clone https://github.com/Yash-Handa/logo-ls.git
```
#### Step 2
`cd` into the directory `logo-ls`. Then run `go mod tidy` to download the dependencies and after that `go build` to build your system specific binary
```cmd
$ cd logo-ls
$ go mod tidy
$ go build
```
the `go build` command will produce `logo-ls` executable binary in the current directory.
#### Step 3
Place the `logo-ls` executable in a directory reachable from `$PATH` env variable.
```cmd
$ sudo cp logo-ls /usr/local/bin
```
#### Step 4
If you want the man page of `logo-ls` place `logo-ls.1.gz` in `/usr/share/man/man1/`
```cmd
$ sudo cp logo-ls.1.gz /usr/share/man/man1/
```
### Check the downloaded Resource
After downloading the Resource(s) from the [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases) follow the bellow steps to check its authenticity.
After downloading the Resource(s) from the [Github Release Page](https://github.com/Yash-Handa/logo-ls/releases) follow the below steps to check its authenticity.
#### Step 1
+7
View File
@@ -94,6 +94,13 @@ func (w *CTW) Flush(buf *bytes.Buffer) {
totW := widthsSum(iw, pad) //total width of the ls block
if totW > w.termW {
// not even first iteration done print similar to logo-ls -1
if len(widths) == 0 {
widths = make([][4]int, len(iw))
for i := range iw {
widths[i] = iw[i]
}
}
break
} else if totW >= w.termW/2 { // if total width of the ls block is more than half of terminal
// copy iw to widths
+3
View File
@@ -58,6 +58,9 @@ func newDir(d *os.File) (*dir, error) {
var gitRepoStatus map[string]string // could be nil
if flagVector&flag_D > 0 {
gitRepoStatus = getFilesGitStatus(d.Name()) // returns map or nil
if len(gitRepoStatus) == 0 {
gitRepoStatus = nil
}
}
if curDir {
+1 -1
View File
@@ -29,7 +29,7 @@ func getRepoStatus(path string) (git.Status, string, error) {
func getFilesGitStatus(p string) map[string]string {
gitRepo, gitRoot, err := getRepoStatus(p)
if err != nil {
if err != nil || len(gitRepo) == 0 {
return nil
}
pAbs, err := filepath.Abs(p)
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -142,7 +142,7 @@ func main() {
// if f_V is provided version will be printed and exit(0)
if *f_V {
fmt.Printf("logo-ls %s\nCopyright (c) 2020 Yash Handa\nLicense MIT <https://opensource.org/licenses/MIT>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n", "v1.3.3")
fmt.Printf("logo-ls %s\nCopyright (c) 2020 Yash Handa\nLicense MIT <https://opensource.org/licenses/MIT>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n", "v1.3.5")
fmt.Println("\nWritten by Yash Handa")
os.Exit(osExitCode)
}