mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
8a85e8b7a8
commit
9d9920d36a
@ -3,7 +3,6 @@ package nfs
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"io/fs"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"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())
|
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())) {
|
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) {
|
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)
|
cb(f, p)
|
||||||
continue
|
continue
|
||||||
case func(p string):
|
case func(p string):
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"archive/tar"
|
"archive/tar"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ func init() {
|
|||||||
for _, k := range arg[1:] {
|
for _, k := range arg[1:] {
|
||||||
m.Option(DIR_TYPE, TYPE_CAT)
|
m.Option(DIR_TYPE, TYPE_CAT)
|
||||||
m.Option(DIR_DEEP, ice.TRUE)
|
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()
|
total += f.Size()
|
||||||
|
|
||||||
header, err := tar.FileInfoHeader(f, p)
|
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 {
|
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)
|
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
|
change = true
|
||||||
}
|
}
|
||||||
return text
|
return text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user