src

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PREFERENCE_DIR_PATH   = "~/Library/Preferences/Mac-sync-config"
	MAC_SYNC_CONFIGS_FILE = "mac-sync-configs.yaml"
)
View Source
const GH_BOT_EMAIL = "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
View Source
const PRESS_ANYKEY_HELP_MSG = "Press any key to continue."
View Source
const PULL_HELP_MSG = `Press 'y' to update the configuration.
Press 'n' to ignore.
Press 'd' to view diff.
Press 'q' to quit.`
View Source
const PUSH_HELP_MSG = `` /* 170-byte string literal not displayed */

Variables

View Source
var (
	Git gitManipulator
)
View Source
var (
	Github gitHubManipulator
)
View Source
var KeychainPreference = GetKeychainPreference()
View Source
var (
	LocalPreferencePath = strings.Join([]string{PREFERENCE_DIR_PATH, "local-preference.json"}, "/")
)
View Source
var (
	Logger loggerType
)

Functions

func CopyFiles

func CopyFiles(srcPath string, dstPath string)

func EditFile

func EditFile(filePath string)

func GetGitBranchName

func GetGitBranchName() string

func GetProfileName

func GetProfileName() string

func GetRemoteConfigFolderName

func GetRemoteConfigFolderName() string

func HandleWhiteSpaceInPath

func HandleWhiteSpaceInPath(path string) string

func ReadJSON

func ReadJSON(filePath string) map[string]string

func ReadLocalPreference

func ReadLocalPreference() map[string]string

func RelativePathToAbs

func RelativePathToAbs(path string) string

func ReplaceMacOSUserName

func ReplaceMacOSUserName(path string) string

func WriteJSON

func WriteJSON(filePath string, jsonData map[string]string)

func WriteLocalPreference

func WriteLocalPreference(localPreference map[string]string)

Types

type KeychainPreferenceType

type KeychainPreferenceType struct {
	GithubId                       string `json:"github_id"`
	GithubAccessToken              string `json:"github_access_token"`
	MacSyncConfigGitRepositoryName string `json:"repository_name"`
}

func GetKeychainPreference

func GetKeychainPreference() KeychainPreferenceType

type MacSyncConfigs

type MacSyncConfigs struct {
	ConfigPathsToSync []string `yaml:"sync"`
}

func ReadMacSyncConfigFile

func ReadMacSyncConfigFile(filepath string) MacSyncConfigs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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