Documentation
¶
Index ¶
- Variables
- func CloneRepoViaHTTP(path string, url string, repo string)
- func CompareFile(file1Path string, file2Path string) (bool, error)
- func CreateDir(dirPath string) error
- func CreateFile(filePath string) error
- func DeleteFile(filePath string) error
- func FileEmpty(filePath string) bool
- func FileExist(filePath string) bool
- func GetHostname() string
- func GetTomlConfig(filePath string) (*toml.Tree, error)
- func GetUserInfo(uid int) (*user.User, error)
- func GetVariable(key string) string
- func GoToDir(dirPath string) error
- func InstallFile(sourceFile, targetFile string) error
- func PolicyKitAuthentication()
- func ProgramInfo() string
- func RunCommandGetFlag(command string, args []string) bool
- func RunCommandGetResult(command string, args []string) string
- func SetVariable(key, value string) error
- func WriteFile(filePath string, content string) error
- func WriteTomlConfig(filePath string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DockerConfig = `[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --data-root=` + varHome + `/Documents/Docker/Root -H fd://
`
View Source
var DockerConfigFile = "/etc/systemd/system/docker.service.d/override.conf"
docker配置文件内容
View Source
var GitConfig = `[user] name = ` + GetHostname() + ` email = yj1516268@outlook.com [core] editor = /usr/bin/nvim autocrlf = input [merge] tool = vimdiff [color] ui = true [pull] rebase = false [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true `
View Source
var GitConfigFile = varHome + "/.gitconfig"
git配置文件内容
View Source
var NpmConfig = `registry=https://registry.npm.taobao.org`
View Source
var NpmConfigFile = varHome + "/.npmrc"
npm配置文件内容
View Source
var PipConfig = `[global]
index-url = http://mirrors.aliyun.com/pypi/simple
trusted-host = mirrors.aliyun.com
`
View Source
var PipConfigFile = varHome + "/.config/pip/pip.conf"
pip配置文件内容
Functions ¶
func CloneRepoViaHTTP ¶ added in v0.1.2
通过HTTP协议克隆仓库
func CompareFile ¶ added in v0.1.0
并发比较两个文件是否相同
func GetTomlConfig ¶ added in v0.0.4
读取toml配置文件
func InstallFile ¶ added in v0.1.0
复制文件,如果文件存在则覆盖
func PolicyKitAuthentication ¶ added in v0.1.0
func PolicyKitAuthentication()
func ProgramInfo ¶
func ProgramInfo() string
func RunCommandGetFlag ¶ added in v0.0.5
运行指定命令并获取标志位
func RunCommandGetResult ¶ added in v0.0.5
运行指定命令并获取命令输出
func WriteTomlConfig ¶ added in v0.0.4
写入toml配置文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.