mirror of
https://github.com/Yash-Handa/logo-ls.git
synced 2026-08-27 10:12:45 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
601e3567d7 | ||
|
|
13a45eb843 | ||
|
|
e0b7546408 | ||
|
|
1b719af25b | ||
|
|
8606cb53e0 | ||
|
|
7e1e31f87f | ||
|
|
8f2e99cccd | ||
|
|
a59d69ec3a | ||
|
|
f776e08b70 | ||
|
|
28797b6281 | ||
|
|
60585a6a50 | ||
|
|
6ebebf05d6 | ||
|
|
ba0f74c973 | ||
|
|
43b0e86ef2 | ||
|
|
3c630eb4e5 |
@@ -1,9 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# build the binery
|
||||
go build
|
||||
|
||||
# Update HELP.md file
|
||||
echo -e "\`\`\`txt" > HELP.md
|
||||
go run . -? >> HELP.md
|
||||
./logo-ls -? >> HELP.md
|
||||
echo -e "\`\`\`" >> HELP.md
|
||||
exec git add HELP.md
|
||||
|
||||
# Update logo-ls.1.gz
|
||||
exec help2man -N -I logo-ls.h2m -o logo-ls.1 ./logo-ls
|
||||
exec gzip -f logo-ls.1
|
||||
exec git add logo-ls.1.gz
|
||||
|
||||
exit 0
|
||||
|
||||
+35
-35
@@ -1,43 +1,43 @@
|
||||
#!/bin/sh
|
||||
# #!/bin/sh
|
||||
|
||||
R_NAME=$1
|
||||
R_URL=$2
|
||||
# R_NAME=$1
|
||||
# R_URL=$2
|
||||
|
||||
error_exit()
|
||||
{
|
||||
if [ "$?" != "0" ]; then
|
||||
nl=$'\n'
|
||||
echo "$1""$nl""$2""$nl""$nl""Aborting push to ""$R_NAME"" (""$R_URL"")" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
# error_exit()
|
||||
# {
|
||||
# if [ "$?" != "0" ]; then
|
||||
# nl=$'\n'
|
||||
# echo "$1""$nl""$2""$nl""$nl""Aborting push to ""$R_NAME"" (""$R_URL"")" 1>&2
|
||||
# exit 1
|
||||
# fi
|
||||
# }
|
||||
|
||||
# Build binary for variety of arch
|
||||
# linux amd64
|
||||
ERROR=$(go env -w GOOS=linux GOARCH=amd64 2>&1 > /dev/null)
|
||||
error_exit "Cannot set GOOS=linux and GOARCH=amd64:" "$ERROR"
|
||||
ERROR=$(go build -o build/logo-ls-linux-amd64 2>&1 > /dev/null)
|
||||
error_exit "Cannot build logo-ls-linux-amd64:" "$ERROR"
|
||||
# # Build binary for variety of arch
|
||||
# # linux amd64
|
||||
# ERROR=$(go env -w GOOS=linux GOARCH=amd64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot set GOOS=linux and GOARCH=amd64:" "$ERROR"
|
||||
# ERROR=$(go build -o build/logo-ls-linux-amd64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot build logo-ls-linux-amd64:" "$ERROR"
|
||||
|
||||
# linux arm64
|
||||
ERROR=$(go env -w GOOS=linux GOARCH=arm64 2>&1 > /dev/null)
|
||||
error_exit "Cannot set GOOS=linux and GOARCH=arm64:" "$ERROR"
|
||||
ERROR=$(go build -o build/logo-ls-linux-arm64 2>&1 > /dev/null)
|
||||
error_exit "Cannot build logo-ls-linux-arm64:" "$ERROR"
|
||||
# # linux arm64
|
||||
# ERROR=$(go env -w GOOS=linux GOARCH=arm64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot set GOOS=linux and GOARCH=arm64:" "$ERROR"
|
||||
# ERROR=$(go build -o build/logo-ls-linux-arm64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot build logo-ls-linux-arm64:" "$ERROR"
|
||||
|
||||
# linux 386
|
||||
ERROR=$(go env -w GOOS=linux GOARCH=386 2>&1 > /dev/null)
|
||||
error_exit "Cannot set GOOS=linux and GOARCH=386:" "$ERROR"
|
||||
ERROR=$(go build -o build/logo-ls-linux-386 2>&1 > /dev/null)
|
||||
error_exit "Cannot build logo-ls-linux-386:" "$ERROR"
|
||||
# # linux 386
|
||||
# ERROR=$(go env -w GOOS=linux GOARCH=386 2>&1 > /dev/null)
|
||||
# error_exit "Cannot set GOOS=linux and GOARCH=386:" "$ERROR"
|
||||
# ERROR=$(go build -o build/logo-ls-linux-386 2>&1 > /dev/null)
|
||||
# error_exit "Cannot build logo-ls-linux-386:" "$ERROR"
|
||||
|
||||
# darwin amd64
|
||||
ERROR=$(go env -w GOOS=darwin GOARCH=amd64 2>&1 > /dev/null)
|
||||
error_exit "Cannot set GOOS=darwin and GOARCH=amd64:" "$ERROR"
|
||||
ERROR=$(go build -o build/logo-ls-darwin-amd64 2>&1 > /dev/null)
|
||||
error_exit "Cannot build logo-ls-darwin-amd64:" "$ERROR"
|
||||
# # darwin amd64
|
||||
# ERROR=$(go env -w GOOS=darwin GOARCH=amd64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot set GOOS=darwin and GOARCH=amd64:" "$ERROR"
|
||||
# ERROR=$(go build -o build/logo-ls-darwin-amd64 2>&1 > /dev/null)
|
||||
# error_exit "Cannot build logo-ls-darwin-amd64:" "$ERROR"
|
||||
|
||||
# reset env to default
|
||||
go env -u GOOS GOARCH
|
||||
# # reset env to default
|
||||
# go env -u GOOS GOARCH
|
||||
|
||||
exit 0
|
||||
# exit 0
|
||||
|
||||
@@ -17,3 +17,10 @@
|
||||
# Do not commit the executable
|
||||
logo-ls
|
||||
build/
|
||||
|
||||
# distribution directory
|
||||
dist
|
||||
|
||||
# env stuff
|
||||
*.env
|
||||
.gh_token
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# This is an example goreleaser.yaml file with some sane defaults.
|
||||
# Make sure to check the documentation at http://goreleaser.com
|
||||
|
||||
env_files:
|
||||
github_token: '{{ .Env.PWD }}.gh_token'
|
||||
|
||||
project_name: logo-ls
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod download
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
# supported OS
|
||||
goos:
|
||||
- linux
|
||||
# - windows
|
||||
- darwin
|
||||
# supported ARCH
|
||||
goarch:
|
||||
- amd64
|
||||
- 386
|
||||
- arm64
|
||||
- arm
|
||||
# OS ARCH combinations to ignore
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: 386
|
||||
# Set the modified timestamp on the output binaries to the latest commit time.
|
||||
# Required for producing Reproducible builds
|
||||
mod_timestamp: '{{ .CommitTimestamp }}'
|
||||
|
||||
archives:
|
||||
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||
replacements:
|
||||
darwin: Darwin
|
||||
linux: Linux
|
||||
windows: Windows
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
# override archiving [default tar.gz]
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
# wrap the content of archive in a dir
|
||||
#so when extracting the content will be in a dir
|
||||
wrap_in_directory: true
|
||||
# files to be included in the archive + binary
|
||||
files:
|
||||
- LICENSE
|
||||
- HELP.md
|
||||
- logo-ls.1.gz
|
||||
# - CHANGELOG.md
|
||||
|
||||
checksum:
|
||||
name_template: '{{ .ProjectName }}_SHA512sums.txt'
|
||||
algorithm: sha512
|
||||
|
||||
signs:
|
||||
-
|
||||
cmd: gpg2
|
||||
# sign the checksum with Yash Handa (logo-ls) <yashhanda7@yahoo.com>
|
||||
args: ["-u", "0xD9498B225223344C0205FDF528182066BCACCCB2", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||
artifacts: checksum
|
||||
|
||||
release:
|
||||
github:
|
||||
owner: Yash-Handa
|
||||
name: logo-ls
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ .Tag }}-next"
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- '^test:'
|
||||
- '(?i)update Readme.md'
|
||||
|
||||
nfpms:
|
||||
-
|
||||
file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||
package_name: logo-ls
|
||||
homepage: https://github.com/Yash-Handa/logo-ls
|
||||
description: ls command with icons and git integration. Written in Golang
|
||||
maintainer: Yash Handa <yashhanda7@yahoo.com>
|
||||
license: MIT
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
dependencies:
|
||||
- git
|
||||
recommends:
|
||||
- golang
|
||||
files:
|
||||
"logo-ls.1.gz": "/usr/share/man/man1/logo-ls.1.gz"
|
||||
@@ -1,7 +1,9 @@
|
||||
```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: logo-ls [-1?aAcdDgGhiloRrSstUvVX] [-T value] [files ...]
|
||||
-1 list one file per line.
|
||||
-? display this help and exit
|
||||
-?, --help display this help and exit
|
||||
-a, --all do not ignore entries starting with .
|
||||
-A, --almost-all do not list implied . and ..
|
||||
-c, --disable-color
|
||||
@@ -30,16 +32,21 @@ Usage: logo-ls [-1?aAcdDgGhiloRrSstUvVX] [-T value] [files ...]
|
||||
-X sort alphabetically by entry extension
|
||||
|
||||
Possible value for --time-style (-T)
|
||||
ANSIC "Mon Jan _2 15:04:05 2006"
|
||||
UnixDate "Mon Jan _2 15:04:05 MST 2006"
|
||||
RubyDate "Mon Jan 02 15:04:05 -0700 2006"
|
||||
RFC822 "02 Jan 06 15:04 MST"
|
||||
RFC822Z "02 Jan 06 15:04 -0700"
|
||||
RFC850 "Monday, 02-Jan-06 15:04:05 MST"
|
||||
RFC1123 "Mon, 02 Jan 2006 15:04:05 MST"
|
||||
RFC1123Z "Mon, 02 Jan 2006 15:04:05 -0700"
|
||||
RFC3339 "2006-01-02T15:04:05Z07:00"
|
||||
Kitchen "3:04PM"
|
||||
Stamp "Mon Jan _2 15:04:05" [Default]
|
||||
StampMilli "Jan _2 15:04:05.000"
|
||||
ANSIC "Mon Jan _2 15:04:05 2006"
|
||||
UnixDate "Mon Jan _2 15:04:05 MST 2006"
|
||||
RubyDate "Mon Jan 02 15:04:05 -0700 2006"
|
||||
RFC822 "02 Jan 06 15:04 MST"
|
||||
RFC822Z "02 Jan 06 15:04 -0700"
|
||||
RFC850 "Monday, 02-Jan-06 15:04:05 MST"
|
||||
RFC1123 "Mon, 02 Jan 2006 15:04:05 MST"
|
||||
RFC1123Z "Mon, 02 Jan 2006 15:04:05 -0700"
|
||||
RFC3339 "2006-01-02T15:04:05Z07:00"
|
||||
Kitchen "3:04PM"
|
||||
Stamp "Mon Jan _2 15:04:05" [Default]
|
||||
StampMilli "Jan _2 15:04:05.000"
|
||||
|
||||
Exit status:
|
||||
0 if OK,
|
||||
1 if minor problems (e.g., cannot access subdirectory),
|
||||
2 if serious trouble (e.g., cannot access command-line argument).
|
||||
```
|
||||
|
||||
@@ -1,9 +1,56 @@
|
||||

|
||||

|
||||

|
||||
|
||||
# logo-ls
|
||||
|
||||

|
||||

|
||||

|
||||
[](http://hits.dwyl.com/{Yash-Handa}/{logo-ls})
|
||||
|
||||
modern ls command with vscode like file logos. Written in Golang
|
||||
|
||||
Command and Arguments supported are listed in [HELP.md](/HELP.md)
|
||||
|
||||
## Check the downloaded Resource
|
||||
|
||||
receive public key of the signing party
|
||||
|
||||
```cmd
|
||||
$ gpg2 --keyid-format long --keyserver keyserver.ubuntu.com --recv-keys 0x28182066bcacccb2
|
||||
|
||||
gpg: key 28182066BCACCCB2: "Yash Handa (logo-ls) <yashhanda7@yahoo.com>" not changed
|
||||
gpg: Total number processed: 1
|
||||
gpg: unchanged: 1
|
||||
```
|
||||
|
||||
check the signature on logo-ls_SHA512sums.txt
|
||||
|
||||
```cmd
|
||||
$ gpg2 --keyid-format long --verify logo-ls_SHA512sums.txt.sig logo-ls_SHA512sums.txt
|
||||
|
||||
gpg: Signature made Tue 08 Sep 2020 10:21:52 PM IST
|
||||
gpg: using RSA key D9498B225223344C0205FDF528182066BCACCCB2
|
||||
gpg: Good signature from "Yash Handa (logo-ls) <yashhanda7@yahoo.com>" [ultimate]
|
||||
```
|
||||
|
||||
A **Good** signature means that the checked file was definitely signed by the owner of the keyfile stated (if they didn’t match, the signature would be reported as **BAD**)
|
||||
|
||||
Now use `logo-ls_SHA512sums.txt` file to verify the authenticity of the resource downloaded
|
||||
|
||||
```cmd
|
||||
$ sha512sum -c logo-ls_SHA512sums.txt 2>&1 | grep OK
|
||||
|
||||
logo-ls_Linux_x86_64.tar.gz: OK
|
||||
logo-ls_Linux_arm64.tar.gz: OK
|
||||
logo-ls_Darwin_x86_64.tar.gz: OK
|
||||
logo-ls_Linux_i386.tar.gz: OK
|
||||
logo-ls_Linux_armv6.tar.gz: OK
|
||||
```
|
||||
|
||||
Note: The downloaded resources to verify and `logo-ls_SHA512sums.txt` should be in the same directory
|
||||
|
||||
## Example Commands
|
||||
|
||||
<div>
|
||||
|
||||
Binary file not shown.
+10
@@ -0,0 +1,10 @@
|
||||
[ENVIRONMENT]
|
||||
For correct display of icons the terminal should support UTF-8 encoding
|
||||
with NERD FONT <https://github.com/ryanoasis/nerd-fonts> patched font.
|
||||
For correct display of colors the terminal should support TRUE COLOR.
|
||||
|
||||
[REPORTING BUGS]
|
||||
Report Bugs to <https://github.com/Yash-Handa/logo-ls/issues>
|
||||
|
||||
[SEE ALSO]
|
||||
Full documentation with examples at: <https://www.github.com/Yash-Handa/logo-ls>
|
||||
@@ -102,7 +102,7 @@ func main() {
|
||||
f_R := getopt.BoolLong("recursive", 'R', "list subdirectories recursively")
|
||||
f_T := getopt.EnumLong("time-style", 'T', []string{"Stamp", "StampMilli", "Kitchen", "ANSIC", "UnixDate", "RubyDate", "RFC1123", "RFC1123Z", "RFC3339", "RFC822", "RFC822Z", "RFC850"}, "Stamp", "time/date format with -l; see time-style below")
|
||||
|
||||
f_help := getopt.Bool('?', "display this help and exit")
|
||||
f_help := getopt.BoolLong("help", '?', "display this help and exit")
|
||||
f_V := getopt.BoolLong("version", 'V', "output version information and exit")
|
||||
|
||||
// using getopt.Getopt instead of parse to provide custom err
|
||||
@@ -115,26 +115,35 @@ func main() {
|
||||
|
||||
// if f_help is provided print help and exit(0)
|
||||
if *f_help {
|
||||
fmt.Println("List information about the FILEs with ICONS and GIT STATUS (the current dir \nby default). Sort entries alphabetically if none of -tvSUX is specified.")
|
||||
|
||||
getopt.PrintUsage(os.Stdout)
|
||||
|
||||
fmt.Println("\nPossible value for --time-style (-T)")
|
||||
fmt.Printf("%-11s %-32q\n", "ANSIC", "Mon Jan _2 15:04:05 2006")
|
||||
fmt.Printf("%-11s %-32q\n", "UnixDate", "Mon Jan _2 15:04:05 MST 2006")
|
||||
fmt.Printf("%-11s %-32q\n", "RubyDate", "Mon Jan 02 15:04:05 -0700 2006")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC822", "02 Jan 06 15:04 MST")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC822Z", "02 Jan 06 15:04 -0700")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC850", "Monday, 02-Jan-06 15:04:05 MST")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC1123", "Mon, 02 Jan 2006 15:04:05 MST")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC1123Z", "Mon, 02 Jan 2006 15:04:05 -0700")
|
||||
fmt.Printf("%-11s %-32q\n", "RFC3339", "2006-01-02T15:04:05Z07:00")
|
||||
fmt.Printf("%-11s %-32q\n", "Kitchen", "3:04PM")
|
||||
fmt.Printf("%-11s %-32q [Default]\n", "Stamp", "Mon Jan _2 15:04:05")
|
||||
fmt.Printf("%-11s %-32q\n", "StampMilli", "Jan _2 15:04:05.000")
|
||||
fmt.Printf(" %-11s %-32q\n", "ANSIC", "Mon Jan _2 15:04:05 2006")
|
||||
fmt.Printf(" %-11s %-32q\n", "UnixDate", "Mon Jan _2 15:04:05 MST 2006")
|
||||
fmt.Printf(" %-11s %-32q\n", "RubyDate", "Mon Jan 02 15:04:05 -0700 2006")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC822", "02 Jan 06 15:04 MST")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC822Z", "02 Jan 06 15:04 -0700")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC850", "Monday, 02-Jan-06 15:04:05 MST")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC1123", "Mon, 02 Jan 2006 15:04:05 MST")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC1123Z", "Mon, 02 Jan 2006 15:04:05 -0700")
|
||||
fmt.Printf(" %-11s %-32q\n", "RFC3339", "2006-01-02T15:04:05Z07:00")
|
||||
fmt.Printf(" %-11s %-32q\n", "Kitchen", "3:04PM")
|
||||
fmt.Printf(" %-11s %-32q [Default]\n", "Stamp", "Mon Jan _2 15:04:05")
|
||||
fmt.Printf(" %-11s %-32q\n", "StampMilli", "Jan _2 15:04:05.000")
|
||||
|
||||
fmt.Println("\nExit status:")
|
||||
fmt.Println(" 0 if OK,")
|
||||
fmt.Println(" 1 if minor problems (e.g., cannot access subdirectory),")
|
||||
fmt.Println(" 2 if serious trouble (e.g., cannot access command-line argument).")
|
||||
os.Exit(osExitCode)
|
||||
}
|
||||
|
||||
// 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.0")
|
||||
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.Println("\nWritten by Yash Handa")
|
||||
os.Exit(osExitCode)
|
||||
}
|
||||
|
||||
@@ -338,7 +347,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Printf("\n\n")
|
||||
os.Exit(osExitCode)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user