🎉 Initial fork

Signed-off-by: milky <op@gfy.lol>
This commit is contained in:
milky 2022-07-19 13:02:36 -07:00
parent 1ce7d3669d
commit a510a8100a
No known key found for this signature in database
GPG Key ID: B6CE41C2DFE6B9B7
11 changed files with 35 additions and 35 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
logo-ls
milk-ls

View File

@ -1,7 +1,7 @@
```txt
List information about the FILEs with ICONS and GIT STATUS (the current dir
by default). Sort entries alphabetically if none of -tvSUX is specified.
Usage: milky-ls [-1?aAcdDgGhiloRrSstUvVX] [-T value] [files ...]
Usage: milk-ls [-1?aAcdDgGhiloRrSstUvVX] [-T value] [files ...]
-1 list one file per line.
-?, --help display this help and exit
-a, --all do not ignore entries starting with .

View File

@ -1,4 +1,4 @@
# milky-ls
# milk-ls
Milked out fork of a modern ' ls ' command with beautiful icons and git integrations.
@ -8,20 +8,20 @@ This was forked because U+FB12 wasn't showing within my tmux sessions, so the cl
## Roadmap
*Updated: ~Thur, July 15th 2022 at 09:00:00 MST*
*Updated: ~Tues, July 19th 2022 at 12:40:00 MST*
#### Milestone Summary:
| Status | Goal |
| :---: | :--- |
| ✅ | [Minimal fork](https://git.tcp.direct/milkyquest/milky-ls) |
| ✅ | [Minimal fork](https://git.tcp.direct/milkyquest/milk-ls) |
| 🚫 | Add preview images |
| 🚫 | [Reimplement *gorelease*](https://git.tcp.direct/milkyquest/milky-ls/issues/1) |
| 🚫 | [Support more glyphs](https://git.tcp.direct/milkyquest/milky-ls/issues/2) |
| 🚫 | [Reimplement *gorelease*](https://git.tcp.direct/milkyquest/milk-ls/issues/1) |
| 🚫 | [Support more glyphs](https://git.tcp.direct/milkyquest/milk-ls/issues/2) |
## Usage
All supported flags can be found by using help flag: ```milky-ls --help```
All supported flags can be found by using help flag: ```milk-ls --help```
The same documentation has been provided within: [HELP.md](/HELP.md)
@ -73,7 +73,7 @@ Doesn't print any icons
### `-c` (or) `--disable-color`:
Doesn't color icons, filenames and git status
- *Note*: use a combination of `-ic` to print output to a file `$ milky-ls -ic > t.txt`
- *Note*: use a combination of `-ic` to print output to a file `$ milk-ls -ic > t.txt`
### Multiple Files and Directories:
@ -83,7 +83,7 @@ You can provide multiple files and directories as command argument (defaults to
## Prerequisites
In-order to get `milky-ls` working properly, you need the following:
In-order to get `milk-ls` working properly, you need the following:
- **UTF-8**: A terminal that is UTF-8 encoded (can display Unicode-Code point).
- **True Color Support**: A terminal that can display color. For more info on colors in the terminal, [see here](https://github.com/termstandard/colors).
@ -98,25 +98,25 @@ It's just as simple to build this tool from source. You should have [Golang](htt
Clone this repository.
```cmd
$ git clone https://git.tcp.direct/milky/milky-ls.git
$ git clone https://git.tcp.direct/milky/milk-ls.git
```
#### Step 2:
`cd` into the directory `milky-ls`. Then run `go mod tidy` to download the dependencies, after that run `go build` to build your system specific binary in the current directory.
`cd` into the directory `milk-ls`. Then run `go mod tidy` to download the dependencies, after that run `go build` to build your system specific binary in the current directory.
```cmd
$ cd milky-ls
$ cd milk-ls
$ go mod tidy
$ go build
```
#### Step 3:
Place the `milky-ls` executable binary in a reachable directory (within the`$PATH` env variable). For me, I'd choose relocate it to either `$GOPATH/bin` or `/usr/bin`.
Place the `milk-ls` executable binary in a reachable directory (within the`$PATH` env variable). For me, I'd choose relocate it to either `$GOPATH/bin` or `/usr/bin`.
```cmd
$ sudo cp milky-ls /usr/bin
$ sudo cp milk-ls /usr/bin
```
## Recommendation
@ -124,5 +124,5 @@ $ sudo cp milky-ls /usr/bin
Personally, I have only one alias in `~/.bashrc` that does the trick for me.
```bash
alias ls="milky-ls -A"
alias ls="milk-ls -A"
```

View File

@ -9,8 +9,8 @@ import (
"sort"
"testing"
"git.tcp.direct/milky/milky-ls/assets"
"git.tcp.direct/milky/milky-ls/internal/ctw"
"git.tcp.direct/milky/milk-ls/assets"
"git.tcp.direct/milky/milk-ls/internal/ctw"
"golang.org/x/term"
)

2
go.mod
View File

@ -1,4 +1,4 @@
module git.tcp.direct/milky/milky-ls
module git.tcp.direct/milky/milk-ls
go 1.18

View File

@ -8,7 +8,7 @@ import (
"strconv"
"time"
"git.tcp.direct/milky/milky-ls/internal/sysState"
"git.tcp.direct/milky/milk-ls/internal/sysState"
"github.com/pborman/getopt/v2"
"golang.org/x/term"
@ -97,7 +97,7 @@ func Bootstrap() {
err := getopt.Getopt(nil)
if err != nil {
// code to handle error
log.Printf("%v\nTry 'milky-ls -?' for more information.", err)
log.Printf("%v\nTry 'milk-ls -?' for more information.", err)
sysState.ExitCode(sysState.Code_Serious)
os.Exit(sysState.GetExitCode())
}

View File

@ -94,7 +94,7 @@ 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 milky-ls -1
// not even first iteration done print similar to milk-ls -1
if len(widths) == 0 {
widths = make([][4]int, len(iw))
for i := range iw {

View File

@ -13,10 +13,10 @@ import (
"strings"
"time"
"git.tcp.direct/milky/milky-ls/assets"
"git.tcp.direct/milky/milky-ls/internal/api"
"git.tcp.direct/milky/milky-ls/internal/ctw"
"git.tcp.direct/milky/milky-ls/internal/sysState"
"git.tcp.direct/milky/milk-ls/assets"
"git.tcp.direct/milky/milk-ls/internal/api"
"git.tcp.direct/milky/milk-ls/internal/ctw"
"git.tcp.direct/milky/milk-ls/internal/sysState"
"github.com/mattn/go-colorable"
)

View File

@ -11,7 +11,7 @@ import (
"strconv"
"syscall"
"git.tcp.direct/milky/milky-ls/internal/api"
"git.tcp.direct/milky/milk-ls/internal/api"
)
func dirBlocks(info *file, fi os.FileInfo) {

View File

@ -5,8 +5,8 @@ import (
"os"
"strings"
"git.tcp.direct/milky/milky-ls/assets"
"git.tcp.direct/milky/milky-ls/internal/api"
"git.tcp.direct/milky/milk-ls/assets"
"git.tcp.direct/milky/milk-ls/internal/api"
)
func mainSort(a, b string) bool {

12
main.go
View File

@ -8,11 +8,11 @@ import (
"runtime"
"sort"
"git.tcp.direct/milky/milky-ls/assets"
"git.tcp.direct/milky/milky-ls/internal/api"
"git.tcp.direct/milky/milky-ls/internal/ctw"
"git.tcp.direct/milky/milky-ls/internal/dir"
"git.tcp.direct/milky/milky-ls/internal/sysState"
"git.tcp.direct/milky/milk-ls/assets"
"git.tcp.direct/milky/milk-ls/internal/api"
"git.tcp.direct/milky/milk-ls/internal/ctw"
"git.tcp.direct/milky/milk-ls/internal/dir"
"git.tcp.direct/milky/milk-ls/internal/sysState"
"github.com/mattn/go-colorable"
)
@ -120,6 +120,6 @@ func main() {
}
func init() {
log.SetPrefix("milky-ls: ")
log.SetPrefix("milk-ls: ")
log.SetFlags(0)
}