From 816c2f6d43304117746d96b6f6e9d1d221f66ab2 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Wed, 27 Mar 2024 10:58:48 -0400 Subject: [PATCH] Replace go-bindata with go:embed --- Makefile | 1 - bindata.go | 315 ----------------------------------------------------- plugn.go | 10 ++ 3 files changed, 10 insertions(+), 316 deletions(-) delete mode 100644 bindata.go diff --git a/Makefile b/Makefile index 895476f..2801320 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,6 @@ validate: test prebuild: git config --global --add safe.directory $(shell pwd) git status - cd / && go install github.com/go-bindata/go-bindata/...@latest cd / && go install github.com/progrium/basht/...@latest test: prebuild docker-image diff --git a/bindata.go b/bindata.go deleted file mode 100644 index 233ec8d..0000000 --- a/bindata.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated for package main by go-bindata DO NOT EDIT. (@generated) -// sources: -// bashenv/bash.bash -// bashenv/cmd.bash -// bashenv/fn.bash -// bashenv/plugn.bash -package main - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -// Name return file name -func (fi bindataFileInfo) Name() string { - return fi.name -} - -// Size return file size -func (fi bindataFileInfo) Size() int64 { - return fi.size -} - -// Mode return file mode -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} - -// Mode return file modify time -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} - -// IsDir return file whether a directory -func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 -} - -// Sys return file is sys mode -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _bashenvBashBash = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x91\x51\x8b\x13\x31\x14\x85\x9f\x3b\xbf\xe2\x6c\x58\x18\x05\x77\x07\x64\x9f\x2a\x2d\xb4\xa8\xd4\x97\x8e\x58\x11\xa5\x14\xb9\xcd\xdc\x69\x82\x99\x44\x72\x13\x6a\xff\xbd\x64\xb4\x32\x56\x9f\x02\xc9\x3d\xdf\x39\x39\xb7\xb2\x3d\xf6\x7b\xa8\xfb\xf5\x6a\xb7\xf9\xfa\xe9\xcd\x87\xdd\xbb\xed\xdb\x56\xe1\xc1\x25\xa8\x27\x85\xc3\xe1\x15\x92\x61\x5f\xcd\x58\x9b\x00\x75\x77\x87\x2f\x21\x47\xc8\x45\x12\x0f\x58\x93\x18\x58\x41\xc8\x09\xa1\x47\x47\x89\xe7\x98\xb0\xda\xad\x9a\x28\xdf\x3b\x26\x61\xe4\xef\xa7\x48\x1d\x23\x85\x5f\xfa\x27\x84\x88\x53\x64\x4a\x1c\x1f\x55\x35\xbb\x46\x7a\x96\x3d\x0d\xfc\x5c\x61\xb1\x80\x7a\x4d\xf1\x6c\xfd\x34\xd0\xc8\xfd\x7d\x40\xb5\x1e\xed\x0e\x9f\x5f\x20\x0b\x63\x13\x06\x3e\x46\x3e\x17\x0b\xeb\x25\x91\x73\x70\x94\x58\xd2\xe8\x38\x57\x57\x59\x0d\xe0\x1e\xe3\xe8\x75\xee\x48\x62\xea\x5b\xfa\x47\xc3\x1e\xd4\x75\xb0\xa9\x30\x1b\x4e\xba\x11\xc3\xce\x09\xc8\x77\xd0\x86\xfc\x89\x71\x29\xcd\x64\xe1\x58\x0b\xc6\xd7\x5b\x23\xc9\x5d\x80\x18\x3c\x68\xa8\xf1\xba\xc9\x12\x1b\x17\x34\xb9\xe6\x68\x7d\x53\xbc\xb1\x5c\x4e\xf9\xaa\xfe\x1b\xa1\x4d\xd1\xcb\xff\x94\xff\xa4\x5e\xc1\x97\x0e\x38\x0e\xd6\x93\x83\xb0\x88\x0d\xbe\xec\xab\x34\x08\xcf\x9a\x45\x28\x5e\xca\x97\x12\x7d\x63\x70\xdf\xb3\x4e\x8f\xea\x0f\xa8\xb7\xd5\x8c\x7f\xd8\x84\x97\x55\x6f\xab\x9f\x01\x00\x00\xff\xff\xbe\x15\xe5\x0d\x2d\x02\x00\x00") - -func bashenvBashBashBytes() ([]byte, error) { - return bindataRead( - _bashenvBashBash, - "bashenv/bash.bash", - ) -} - -func bashenvBashBash() (*asset, error) { - bytes, err := bashenvBashBashBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "bashenv/bash.bash", size: 557, mode: os.FileMode(420), modTime: time.Unix(1652927627, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _bashenvCmdBash = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x54\xc1\x6e\xdb\x3a\x10\x3c\x93\x5f\x31\x6f\x43\x07\xc9\x41\xd0\x93\x4f\x85\x0d\x17\x09\xda\xde\xda\x5e\x72\x8c\x1d\x80\x95\xa8\x58\x88\x4c\x19\xa2\xec\xa6\xb0\xf5\xef\xc5\x52\x94\x22\x25\x3e\xf5\x94\x88\x5c\xce\xce\xcc\xce\x5a\x66\x26\x2d\x75\x6d\x10\xdd\xe3\xcb\x8f\xaf\x0f\x52\xa6\xbb\x2c\x2a\x0b\xd7\xdc\xdc\xe2\x24\x45\x7f\x9d\x19\x97\xae\xe8\x7b\xe1\x1a\x07\x7d\xd4\x45\xa9\x7f\x95\x06\x69\xb5\xdb\x69\x9b\x39\x7a\x2b\xb4\x6e\x45\x2a\x21\x29\x7a\x9c\xe8\xc5\xfc\x71\x20\x65\x1d\xe1\x0c\x67\x32\x90\x8b\x95\x75\x8b\x38\x26\xd9\xbe\xf5\xf3\x75\xd3\xa6\x03\x56\x5e\xd5\x78\x41\x61\x41\xea\xf4\x1f\xd3\x7c\xbc\xdb\xb4\xb4\x44\x56\x49\x21\x4c\xba\xad\x40\xea\x85\x49\x54\xd6\xe0\x8c\xe7\xda\xec\x41\x4f\xdc\xc4\xf7\xac\xea\x66\xd2\xc9\x86\x3e\xff\x02\x1b\x1d\xb1\x78\x87\x69\x5e\xf7\x55\x7d\xd1\xaf\x6f\xfe\xc6\x41\x23\x3f\xd8\xb4\x29\x2a\x0b\xcd\x5f\xc1\xb7\x91\x6d\xb9\xf5\x52\xa1\x59\xf2\x69\xbe\x88\x54\xd2\x92\x14\x65\x95\xea\xd2\xfb\x10\x5c\xb0\x4c\x57\xdd\x8c\xa4\xdc\x4e\xf9\xe6\x96\xc6\x0e\x44\x84\xeb\xcf\x88\x33\x73\x8c\xed\xa1\x2c\x71\x7d\xdd\xb9\x6a\x83\x2c\x29\xbc\x6e\x1e\xcf\x42\x9d\xb4\x8b\xaf\x94\x75\x51\xdc\xd2\x66\xe5\xb1\xa6\x1a\x07\xe7\xde\x4d\x28\xc8\x55\x73\x92\xc2\x1c\x75\x09\x52\x09\x17\x42\x8a\xa9\x23\x6b\x52\xfc\x77\x4d\x52\xf8\x80\x58\x07\x95\x60\x4d\x6b\x75\xb7\xa6\x25\xa4\x68\x43\x72\xba\x7e\xe8\xc6\x1f\x28\x26\x9e\x54\x32\x70\xea\xc9\xbc\x99\xa4\x12\x5a\xc2\x6d\x8b\xbc\x41\x7f\x9c\xee\xb2\xc9\xf9\xf9\x8c\xa6\x3e\x98\xfe\xda\x35\xba\x39\xb8\xd5\xff\x52\x14\x39\x7a\x57\x87\xb4\x7a\x1b\x9f\x54\xba\xcb\xd6\x6a\xe2\xe3\x12\xcd\xd6\x58\x29\x84\x3a\x8d\xfc\x4b\x77\x19\x6d\x5a\x90\xba\x63\x1f\x4a\x67\xa4\x60\xd8\xc7\x47\x90\xbf\xc3\x66\x33\x3c\x0c\xf3\xfa\x59\xc1\x1d\xd2\x6d\x9f\x88\x05\x7c\x21\xdf\x07\x66\x73\x1e\x6d\xd9\xa3\x30\xad\x8f\x20\xea\x26\xb7\x11\xfb\xda\x55\xdc\xf2\xfb\xbc\x08\x99\x18\xa2\x71\xff\x61\x6d\x17\xbe\xb0\xaa\x59\xf8\x34\x57\x01\x28\x44\x4b\xec\xeb\xc2\x36\x39\x08\x98\x45\xf3\x4f\x0e\x33\xb7\xb6\xd4\x8b\x9a\xb4\xff\x68\x47\x47\xa7\xcb\xda\x40\xe8\xb5\x68\xa0\x3a\x85\x92\xa9\x86\x89\x6e\x4d\xb9\xbf\xb4\x47\x0f\xdb\xea\xb7\x03\xdf\xa2\xb0\x79\x55\xef\xb4\xdf\x25\xa6\x7e\x69\x99\x74\xfd\xcc\x61\xe0\x29\xf4\xc6\xf1\xd1\xc8\x3a\x00\xe8\x95\xb3\x48\x9f\x09\xfe\xc7\x1a\x5c\xa1\xd4\xae\x61\x90\xae\x6c\x14\xaf\x13\xc3\xc4\x33\x56\x16\xf3\x0f\x45\x77\x68\x5d\x3c\xc3\xf4\x1b\x71\xd4\xd2\xf8\xb9\xdf\xef\x0b\xe6\x04\x26\x36\x62\x5d\x61\x7d\x93\x21\x3c\x61\x45\xfc\xf2\xb3\x49\xa3\xcd\xe8\xed\xf2\xae\xc8\xbf\x01\x00\x00\xff\xff\x4c\x2e\xf9\x29\xc7\x05\x00\x00") - -func bashenvCmdBashBytes() ([]byte, error) { - return bindataRead( - _bashenvCmdBash, - "bashenv/cmd.bash", - ) -} - -func bashenvCmdBash() (*asset, error) { - bytes, err := bashenvCmdBashBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "bashenv/cmd.bash", size: 1479, mode: os.FileMode(420), modTime: time.Unix(1652927627, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _bashenvFnBash = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x51\x4d\x6f\xe2\x30\x10\x3d\xdb\xbf\xe2\x69\x64\x09\xd0\x2a\x8a\xe0\xca\x66\x8f\x2b\xed\x6f\x60\x39\x58\x66\x4c\xac\xa6\x93\xc8\x36\xa0\x0a\xf2\xdf\x2b\x43\x5a\x72\xa8\xaa\x1e\x3d\xef\xcd\xfb\x18\x6b\x2f\x95\x8d\xc7\xb4\x5c\xe1\xaa\xd5\x81\x5d\x67\x23\xe3\xc0\xc9\x35\xf4\x4f\xd2\xc0\x2e\xc3\xc2\x9f\xc4\xe5\xd0\xcb\x22\xc1\xc6\xe3\xe9\x95\x25\x27\xd2\xaa\xeb\x9d\xed\xca\xa4\x0b\xc2\x8d\x59\xe6\xb7\x81\x61\xd6\xb8\xe1\x18\x79\xc0\x87\xda\xf4\xac\xce\xa0\xb9\x01\xe1\x86\x96\xed\x01\xd5\x7a\xa5\x15\xbb\xb6\x47\xc5\x20\x73\x9d\x04\xeb\x1a\x35\xfd\x17\x1a\x0b\xd1\x5e\x5e\x50\xfd\x6d\xb0\xa8\x9b\xfa\x3a\xc4\x20\x19\xf4\x9b\xcc\x9a\xfe\xd0\xb8\xc0\x0d\x39\xa2\x70\x41\x20\x3d\xea\xd2\xaa\x58\xfc\xb8\x55\x81\x62\x18\xca\x8b\xca\x42\x21\x92\x56\x7c\xb6\x1d\xe8\x8b\x62\xc9\xcd\xc2\xd3\x16\xf7\xf4\xa6\xcc\x27\xf7\x20\xbe\xff\xc6\x3d\xcd\xec\xe9\xc9\xf1\xd2\x94\x4e\x48\x6d\x7f\x49\xfd\x29\x3a\x6e\xc8\x6c\x68\xba\x0e\x19\x2f\x30\xcb\xe9\xc7\x60\xbc\xac\x3e\x21\x3c\x80\x7b\xb2\x19\xa0\x55\xf0\xd8\xed\x40\xe6\x29\x49\xd8\xef\xb7\xc8\x2d\x8b\x56\xea\xd1\xcc\x4b\x39\xa1\x0d\x1d\x2a\xc1\xaf\x8d\x56\xd3\xb2\x0f\x7a\xd4\xef\x01\x00\x00\xff\xff\x5c\xaf\x12\xe0\x23\x02\x00\x00") - -func bashenvFnBashBytes() ([]byte, error) { - return bindataRead( - _bashenvFnBash, - "bashenv/fn.bash", - ) -} - -func bashenvFnBash() (*asset, error) { - bytes, err := bashenvFnBashBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "bashenv/fn.bash", size: 547, mode: os.FileMode(420), modTime: time.Unix(1652927627, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _bashenvPlugnBash = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\x5d\x6f\xdb\x38\x16\x7d\x96\x7e\xc5\x2d\x47\x93\x26\xc5\xd2\xae\xb3\xd8\x97\xc9\x3a\x98\x62\x5a\x74\x0a\x14\x9d\xa2\x1f\xbb\x0f\x69\x11\x30\x22\x25\x11\x91\x48\x95\xa4\xec\xa4\x6d\xfe\xfb\xe2\x92\x94\x2d\xb9\xb2\x93\x9d\xbe\x04\x32\x79\x79\x78\x78\x3f\x0e\x2f\x93\xae\x84\xb1\x52\xab\xe3\x13\xf8\x96\x26\x5c\xe4\x35\x33\x02\xb8\xb0\xf9\x92\xbc\xaf\xf4\x1a\xe2\x3c\x49\x13\x91\x57\x1a\x48\x5b\x77\xa5\xfa\x0d\xb2\x6f\x6f\x5f\x7f\x7c\xf9\xe6\xf2\x3f\x2f\xde\xbd\x7f\xf5\xd7\x9b\xdf\x28\x17\xab\x3b\x92\xde\xa5\xa9\x54\xd6\xb1\xba\x9e\x02\x7c\x15\xa6\x80\x81\x12\x6b\x40\x24\xa9\xa0\x30\xba\x01\x06\x2f\xa5\x83\x8f\xef\x5e\x93\xed\x9a\xce\xd4\x4b\x92\x2d\x08\x28\xd6\x88\x25\xc9\x4e\x49\x9a\xd4\x3a\x67\x35\x5c\x31\x2b\x0a\x59\x0b\x9c\x00\xae\xd7\xaa\xd6\x8c\x0b\x03\xcc\x94\x16\x72\xad\x9c\x50\xce\x42\xbe\xe6\x69\x32\x34\x5d\x92\xec\x18\x7f\xfb\x65\x24\xeb\x4c\x4d\x4e\x48\x9a\xb4\x9d\xad\x38\x90\x0c\x0f\xf4\xea\xcd\xe5\xdb\x67\x1f\xfe\x9c\xb3\x15\x93\x35\xbb\xaa\x05\x81\xa3\xf3\x39\x17\xab\xb9\xea\xea\x3a\x4d\x64\x01\x17\x17\x40\xb2\x21\x2c\x81\xe5\x12\x9e\xcc\x1c\x33\xb3\xf2\x2b\x7c\xfe\x0c\xdf\xbf\xef\x37\xf2\x16\x67\xe0\x2a\xa1\xd2\x24\x59\x57\x32\xaf\x20\xef\x4c\x0d\xe7\xb0\xd9\x06\x4e\xcf\x8f\x16\x70\x74\x34\x38\xda\x92\xa0\x11\xc1\x41\x3c\xe4\x92\x50\x8b\xae\x8a\x00\xeb\x52\xb8\x7b\x01\xd0\x68\x08\xf0\x05\x28\x6d\xd8\x0d\x35\x82\x4b\x23\x72\xb7\x5c\x00\xfd\x8b\x92\x34\x4d\xe2\x29\xe9\x57\x20\xd9\x16\x81\x0c\x89\xc7\x64\x78\x5b\x0b\x66\x05\xc4\x90\x83\x90\xae\x12\x26\x9c\x47\x9b\x40\xcb\xe9\xcd\xf4\x4a\x32\x08\x5e\x22\xb0\x38\x3f\x3a\xf5\x38\x37\xd2\xc1\x22\x4d\x92\x42\xa6\x49\xd2\x5c\x73\x69\x80\xb6\x80\xd1\x46\xae\x9f\xd0\x66\xcc\x22\xf3\x51\x0e\xe1\x83\xef\x08\x08\x37\x5f\x81\xfe\x31\x5e\xd3\x07\xf5\x74\x27\x80\xc9\x2f\xd0\xb0\x6b\x01\xb6\x33\x02\xd6\x02\x3a\xe5\x98\x31\x82\x03\x03\x2b\x55\x59\x0b\x40\x06\x52\x39\x0d\xba\x33\x88\x5e\x0a\x97\x26\x49\x9f\x55\x97\x5c\x1a\xbb\x3c\xce\x8e\x0b\xa9\x38\xcc\x00\x5d\xc8\x45\xeb\x2a\x58\x00\x55\xda\x01\x6d\x99\xab\xe0\xf1\xec\x31\x50\x77\xdb\x0a\xe0\x27\x27\xc3\xe5\x98\x0f\x7b\xd7\xfb\x05\x85\x5f\xd0\x27\xda\xb7\x5f\x46\x3b\x5f\xfc\xfe\xf9\x8e\x00\x15\x5f\x60\x81\x99\x76\x74\xb4\x63\x15\xf0\xb7\x56\x4f\x47\x41\x0b\x4e\x99\xcd\x9f\x0c\x7d\xb2\x71\x59\xf2\x80\x23\x89\x1b\x91\x43\xb3\x02\x5a\xc0\xb7\x3b\x98\xcd\xe6\xf0\xe9\x0c\xd7\xe6\x6b\xbe\x24\xd9\xdb\xff\x3e\x27\x7e\x1f\xdd\xf2\x1d\xb7\x27\xa6\x41\xc7\x92\x2c\x5f\x73\x12\xc3\x2d\x6a\x2b\xd2\x24\x29\xa5\x83\xbc\xd6\xaa\xaf\x49\xc8\x4e\x53\x3f\x1f\x61\xb6\x79\x8d\xf2\xd2\xa9\x03\x02\xf3\x4e\x34\x7a\x25\xc6\xca\xd2\x57\x72\x1c\xb5\x03\x85\x09\x23\x5e\x64\xd2\xc4\x34\x40\x4d\xb1\xa3\x03\x42\xe1\x52\x3e\xcf\x82\xe9\x3e\xb3\xcd\x26\x5b\x43\xa4\xda\x72\xe6\xc4\x14\xcf\x8f\x7e\xa6\xe7\xc9\x14\x07\xdd\x3a\xa9\x15\xab\xeb\x5b\x68\xa5\xc2\xaa\xc9\x75\xd3\x48\x37\x77\xac\x9c\x5f\x19\xa6\xf2\x6a\x9a\x78\xb4\x73\xd2\x56\x51\x23\x2f\x2e\xe0\x11\xd0\xbd\x8a\xb6\xa1\x18\x13\xa8\xaf\x64\x4f\xe5\x38\x4e\x9e\x00\x06\x3e\x7a\x5a\x70\x5f\x57\x7d\xa9\x1e\xd4\xcb\x2d\xfa\x28\xfe\x1b\x4e\xb3\x52\xba\x07\xec\xdc\x30\xc5\x4a\xc1\xe1\xea\x16\xfc\x82\x7e\xfb\xa7\xa9\xd7\xe0\x47\xe0\x93\x46\xab\x42\x96\x40\x69\x59\xeb\x2b\x56\xe3\x87\x70\x14\x95\xc6\xb2\x42\xcc\x82\xac\x69\x73\x0b\xdf\xa1\x34\xa2\x05\xfa\xe5\x5e\xd6\x9b\x5a\x99\xc6\x67\x9c\xef\x62\xdf\x9b\x08\x98\xca\xde\x01\x5e\x4f\xb7\xd1\x22\xdb\x02\x7e\x04\xd9\x31\x6e\x68\x6f\x9b\x2b\x5d\xcb\x9c\x1a\x51\xc0\x9f\x2f\x9e\x3d\x3f\x99\xf2\x54\x2b\x95\x12\x1c\x53\x24\x3b\xfe\x37\xcc\xe6\xb3\xb0\xd3\xe5\x16\xfa\x64\xe8\xb0\x70\x94\x4a\xe4\xd7\xba\x43\xc7\x5a\x27\xcc\xb8\xaa\xbc\x45\xeb\xa5\xe0\x87\xe1\xcd\x42\xba\x33\x19\xef\x08\xf5\xc3\x99\x46\x2e\x2c\x84\xcb\x2b\xa0\xd4\xb1\xd2\xee\x00\x8c\xe1\x07\x20\xbb\x76\xe1\xf0\xa3\x5d\xce\x27\x8f\x9d\x6e\xaf\xa5\x9d\x94\x0a\x95\xc8\x7d\xa5\x0d\xdc\x37\x80\xdc\xa8\xd1\x61\x04\x72\x40\x99\x6a\x69\xdd\x54\xb1\xbf\x96\xd6\x01\x66\x65\x68\x5e\xb6\x32\x64\x2b\xdd\x3a\xa0\x16\x10\x01\x73\x2c\x4d\x0a\x6d\xc0\xab\xad\x54\xb0\x27\xb1\x9e\x9c\x01\xd7\x69\x92\x0c\xd1\x46\x9d\x4d\x86\x00\xd8\xd8\x44\x13\xeb\x98\xeb\x2c\x9a\x60\xc0\x04\x1c\x12\xb8\x61\xbe\xc5\x29\x6c\x67\xfc\x6f\x2e\xad\x1f\x18\x40\xc7\xe6\x10\xb1\x73\xe6\xc2\xce\xf3\x80\x34\x73\xba\xa9\xf1\x7e\xd6\x4d\x8d\x75\x19\x3a\x47\x14\x06\xd2\xb7\x94\x03\xa0\xe0\xa9\xff\x0b\x05\x97\x18\xe9\x65\x33\x20\xb5\x46\x2a\x57\x00\x01\xf8\x95\x9e\x3e\xb5\xf0\x2b\xfd\x17\xfe\x59\xe0\xa7\xfd\x84\x4b\x36\xda\x44\xb2\x9e\x03\x90\x2c\xf8\x07\xbf\x10\x12\x55\x56\x2b\xb1\x89\x4e\xb7\x8d\xce\x5d\x9a\x3a\x23\xcb\x52\x98\xa9\x30\x7f\x08\x53\x16\x2a\xad\xaf\x31\x7e\xbd\xff\x7e\xbc\x77\xd0\xc2\x8b\xf7\x19\xd8\x4a\x16\x6e\x7f\x2a\x84\xa0\xec\x26\x43\x1f\xb4\x3e\x15\x62\x2d\x16\x9b\x13\xce\x33\xdc\x62\xdc\xb1\x45\xa3\x9b\x83\x46\x89\x58\xb1\x1a\x30\x10\x5e\xfb\xa8\xb8\x69\xb5\x71\x30\xca\xae\x50\x11\xde\xe5\x49\x32\xc2\x02\x92\xfd\xee\x87\x63\x2d\xf5\xd5\x14\x5d\x03\x8f\xbd\xd5\x63\x90\xd6\x8b\x3c\x36\x13\x9d\xc3\xa3\xfc\x03\xec\xb5\x6c\x5b\xa9\xca\xfe\xc8\xc7\x93\x5b\x6e\xda\x46\xdf\x2d\xe2\x9f\x7d\xb1\x4a\x62\xa4\x68\xc9\x9c\x58\xb3\x5b\x18\x10\xbc\x4b\xd3\xe0\xc1\xa9\x30\xbe\xf0\x33\xc0\x60\xa3\xdf\x93\xdd\xc2\xa0\x53\x9d\x88\x0c\xbe\x54\x14\xd0\xc2\xde\x7f\x4d\xde\xdb\x6f\x08\x6c\x7c\xfb\x63\x20\xf7\x58\x87\x53\xe4\x9f\x87\xa9\x9f\x67\x6f\x9a\xbf\x41\x2c\xe6\x4c\x29\x26\x65\xf0\xa5\x70\x7d\x70\x83\x61\x67\x98\x0b\x2f\xcb\xa9\xb6\x66\xf0\xe8\x43\x51\x18\xb3\x09\x00\x5e\x1c\xc8\x48\x1d\x06\x6e\xf5\xaf\xae\x01\xad\x90\xca\x93\x21\x0f\x49\xfe\x70\x72\x0f\xa5\x14\xab\x87\x0c\x9b\xc2\xc8\xc6\x4e\x3b\xe9\xfd\xdf\x74\x12\xac\x58\xdd\xe1\xe7\x3f\xfb\x87\xba\xbf\x99\xfd\xe8\x86\x8e\x15\x07\x49\x4f\x3a\x4f\x2a\x39\x49\xf4\x95\x92\x4e\xb2\x5a\x7e\x15\xc0\x14\x88\xa6\x75\xb7\x3d\x71\x94\xef\xbd\x39\x46\xd2\xc4\xe9\x2e\xaf\x0e\x10\x79\x40\x7a\xee\x31\xd8\xbe\xda\xfb\xff\x56\x6c\x69\xf2\x48\x12\x6f\x76\x35\xa4\xba\xab\xae\xfe\xd8\x97\x56\x77\x26\x9f\xac\xb1\xf7\x7e\xc6\xb7\xdd\x4c\x71\x0b\xa8\xd3\xde\x7a\xe7\x91\xf1\x33\x92\x0e\x90\x24\xbb\x8a\xfe\xa3\x1e\xce\xb6\x4d\x64\x38\x6d\x20\x0d\xf7\x2c\x39\x78\xc1\x35\x4c\xc6\xff\x05\x61\xb6\x50\xa1\xa1\x95\xad\x28\x98\xac\xcf\xc2\x53\xf3\xc3\xbb\x67\x7f\xbc\xe8\xb7\xf5\x36\x37\x69\x9a\xe4\x0d\xef\xb3\x3d\xde\xac\xa3\xb1\xf8\x90\x18\x8d\x6d\x1e\x72\xe3\x51\xdf\x67\x8d\x86\xb0\xaf\x1a\x0d\x44\x69\x1f\x8d\x05\xff\x8d\x86\xa2\x4e\x8e\xc6\x62\x5c\x7b\x57\x91\xe1\x24\x55\xb6\x6f\xf9\xfb\xfe\x6f\xb7\x06\x07\x48\x5b\xb1\x9b\x1a\x0e\xbf\xa6\x66\xec\xce\x02\x2c\xb0\xe8\x40\x65\x81\x90\xfe\x8a\xfa\x5f\x00\x00\x00\xff\xff\x49\xba\xc1\x9e\x99\x13\x00\x00") - -func bashenvPlugnBashBytes() ([]byte, error) { - return bindataRead( - _bashenvPlugnBash, - "bashenv/plugn.bash", - ) -} - -func bashenvPlugnBash() (*asset, error) { - bytes, err := bashenvPlugnBashBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "bashenv/plugn.bash", size: 5017, mode: os.FileMode(420), modTime: time.Unix(1652934430, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "bashenv/bash.bash": bashenvBashBash, - "bashenv/cmd.bash": bashenvCmdBash, - "bashenv/fn.bash": bashenvFnBash, - "bashenv/plugn.bash": bashenvPlugnBash, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "bashenv": &bintree{nil, map[string]*bintree{ - "bash.bash": &bintree{bashenvBashBash, map[string]*bintree{}}, - "cmd.bash": &bintree{bashenvCmdBash, map[string]*bintree{}}, - "fn.bash": &bintree{bashenvFnBash, map[string]*bintree{}}, - "plugn.bash": &bintree{bashenvPlugnBash, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/plugn.go b/plugn.go index fc7a6ff..355cf3b 100644 --- a/plugn.go +++ b/plugn.go @@ -1,6 +1,7 @@ package main import ( + "embed" "fmt" "io/ioutil" "log" @@ -15,6 +16,15 @@ import ( var Version string var PluginPath string +var ( + //go:embed bashenv/* + fs embed.FS +) + +func Asset(name string) ([]byte, error) { + return fs.ReadFile(filepath.ToSlash(name)) +} + func assert(err error) { if err != nil { log.Fatal(err)