utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DotmanDirName         = ".dotman"
	DotFilesBackupDirName = "dotfiles-backup"
	GitUserName           = "dotman"
	ExternalsDirName      = "externals"
)

Variables

View Source
var DotfileBackupDir string = DotmanDir + "/" + DotFilesBackupDirName
View Source
var DotmanDir string = HomeDir + "/" + DotmanDirName
View Source
var EnableInteractiveCommand bool = false
View Source
var ExternalsDir string = DotmanDir + "/" + ExternalsDirName
View Source
var GitDir string = "--git-dir=" + DotmanDir
View Source
var HomeDir string = GetHomeDir()
View Source
var WorkTree string = "--work-tree=" + HomeDir

Functions

func Contains

func Contains(s []string, str string) bool

contains checks if a string is present in a slice

func CopyFile

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

func CreateDir

func CreateDir(path string) error

func GetDeletedOrModifiedFiles

func GetDeletedOrModifiedFiles(repoPath string, currentCommitID []byte, isDeletedFiles bool) []string

func GetHomeDir

func GetHomeDir() string

func GitCommand

func GitCommand(isInteractive bool, currentDir string, args ...string) ([]byte, error)

func IsGitRepoDir

func IsGitRepoDir(repoPath string) bool

func IsRepoUpToDate

func IsRepoUpToDate(repoPath string) bool

Check if repo already up to date

func PromptGetInput

func PromptGetInput(params PromptParams) string

func RemoveRunes

func RemoveRunes(input string) string

func RunCommand

func RunCommand(binary string, args ...string) (*exec.Cmd, error)

Types

type NotInstalled

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

func (*NotInstalled) Error

func (e *NotInstalled) Error() string

type PromptParams

type PromptParams struct {
	Label    string
	ErrorMsg string
}

Jump to

Keyboard shortcuts

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