citools

package
v0.0.0-...-ee0865d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultIgnoreReg *regexp.Regexp = regexp.MustCompile(`/\.`)
)
View Source
var (
	SyncResourcePngOptLevel = 2
)

Functions

func Command

func Command(cmd string, args map[string]string, params ...string) (err error)

func CommandExec

func CommandExec(cmd string)

func CommandExecNoPanic

func CommandExecNoPanic(cmd string)

func CommandGet

func CommandGet(cmd string) (result string, err error)

func CompressFile

func CompressFile(filename string)

func CompressResource

func CompressResource(srcDir string, tarDir string, cacheDir string, ignore *regexp.Regexp)

func CompressResourceSelf

func CompressResourceSelf(srcDir string, ignore *regexp.Regexp)

func CopyFile

func CopyFile(source, dest string)

func FormatPath

func FormatPath(p string) string

func GetDirFiles

func GetDirFiles(dirname string, ignoreDir []string, ignoreReg *regexp.Regexp) (files []string, err error)

func JsonCombineDir

func JsonCombineDir(src string, tar string)

/ Json-合并src目录中所有的json文件到目标tar文件中

func JsonModify

func JsonModify(file string, key string, val interface{})

/ Json-修改json文件file的值 / 会格式化文件

func RemoveDir

func RemoveDir(dir string)

/ 删除目录

func RemoveFile

func RemoveFile(target string)

/ 删除文件

func ReplaceText

func ReplaceText(file string, old string, new string)

/ 替换文本

func ReplaceTextFunc

func ReplaceTextFunc(file string, old string, repl func(string) string)

/ 替换文本,通过func

func Sync

func Sync(source, target string, info bool) (err error)

func SyncDir

func SyncDir(source string, target string, ignore *regexp.Regexp)

func SyncFile

func SyncFile(source string, target string)

func SyncIgnore

func SyncIgnore(source, target string, info bool, ignoreDir []string) (err error)

拷贝文件 要拷贝的文件路径 拷贝到哪里

func SyncResource

func SyncResource(src string, target string, config string, group string, atlas string, bin string, ignore *regexp.Regexp)

Types

type AtlasItem

type AtlasItem struct {
	Prefix  string
	Name    string
	Path    string
	FileMap map[string]string
}

type ConfigItem

type ConfigItem struct {
	Sync  string   `json:"sync"`
	Group []string `json:"group"`
}

func NewConfigItem

func NewConfigItem() *ConfigItem

type DirItem

type DirItem struct {
	Name    string
	FileSet set.Set
}

type SyncItem

type SyncItem struct {
	File   string
	Source string
	Target string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL