goshell

package module
v0.0.0-...-1a1fccb Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 13 Imported by: 0

README

zip

压缩文件、目录 解压文件、目录

run

执行命令、打开自定义进程

rm

删除文件、目录

ls

查看目录文件、目录信息

copy

复制文件、目录

config

配置shell基本行为

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cd

func Cd(dirPath string) error

func ClearDir

func ClearDir(dirPath string) error

清空文件夹

func CopyDir

func CopyDir(src, dst string) error

拷贝目录

func CopyFile

func CopyFile(src, dst string) error

拷贝文件

func CurrentDir

func CurrentDir() (string, error)

func GetFileInfo

func GetFileInfo(src string) os.FileInfo

判断文件或目录是否存在

func IsStrInArr

func IsStrInArr(s string, arr []string) bool

func Ls

func Ls(dirPath string) (files []string, dirs []string, err error)

func Move

func Move(oldpath, newpath string) error

移动

func MustCd

func MustCd(dirPath string)

func MustCurrentDir

func MustCurrentDir() string

func MustMove

func MustMove(oldpath, newpath string)

移动

func MustRename

func MustRename(oldpath, newpath string)

改名字

func MustRun

func MustRun(arg0 string, argN ...string) string

func MustWhich

func MustWhich(name string) string

func Rename

func Rename(oldpath, newpath string) error

改名字

func ResolveArgs0

func ResolveArgs0(arg0 string) (string, error)

找全路径:返回全路径,或者错误提示

func Rm

func Rm(filePath string) error

删除文件或者目录

func SetWhich

func SetWhich(name, rawpath string)

设置which的路径,which查找的时候优先用这个

func UnZip

func UnZip(dst, src string) (err error)

func Which

func Which(name string) (string, error)

按平台实现 windows下where; mac和linux下用which

func Zip

func Zip(dst string, srcList ...string) (err error)

dist-必须是个文件路径 src

Types

type Config

type Config struct {
	Version     string            `yml:"version"`
	Which       map[string]string `yml:"which"`
	DisableMuti bool              `yml:"disableMuti"`
}

type MutiWriter

type MutiWriter struct {
	// contains filtered or unexported fields
}

func NewMutiWriter

func NewMutiWriter(writes ...io.Writer) *MutiWriter

func (*MutiWriter) Write

func (this *MutiWriter) Write(data []byte) (int, error)

type Result

type Result struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
	Success  bool
}

func Run

func Run(arg0 string, argN ...string) (*Result, error)

func (Result) String

func (me Result) String() string

Jump to

Keyboard shortcuts

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