mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
8a85e8b7a8
commit
9d9920d36a
@ -3,7 +3,6 @@ package nfs
|
||||
import (
|
||||
"bufio"
|
||||
"crypto/sha1"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
@ -50,7 +49,7 @@ func _dir_list(m *ice.Message, root string, name string, level int, deep bool, d
|
||||
p := path.Join(root, name, f.Name())
|
||||
if !(dir_type == TYPE_CAT && f.IsDir() || dir_type == TYPE_DIR && !f.IsDir()) && (dir_reg == nil || dir_reg.MatchString(f.Name())) {
|
||||
switch cb := m.Optionv(kit.Keycb(DIR)).(type) {
|
||||
case func(f fs.FileInfo, p string):
|
||||
case func(f os.FileInfo, p string):
|
||||
cb(f, p)
|
||||
continue
|
||||
case func(p string):
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@ -39,7 +38,7 @@ func init() {
|
||||
for _, k := range arg[1:] {
|
||||
m.Option(DIR_TYPE, TYPE_CAT)
|
||||
m.Option(DIR_DEEP, ice.TRUE)
|
||||
m.Cmdy(DIR, k, func(f fs.FileInfo, p string) {
|
||||
m.Cmdy(DIR, k, func(f os.FileInfo, p string) {
|
||||
total += f.Size()
|
||||
|
||||
header, err := tar.FileInfoHeader(f, p)
|
||||
|
@ -58,7 +58,7 @@ func _status_tags(m *ice.Message) {
|
||||
}
|
||||
if v, ok := vs[kit.Slice(strings.Split(ls[0], ice.PS), -1)[0]]; ok && ls[1] != v {
|
||||
m.Info("upgrade to %v %v from %v", ls[0], ls[1], v)
|
||||
text = ice.TB + ls[0] + ice.SP + v
|
||||
text = strings.Replace(text, v, ls[1], 1)
|
||||
change = true
|
||||
}
|
||||
return text
|
||||
|
Loading…
x
Reference in New Issue
Block a user