env

package
v0.0.0-...-6322789 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppFs = afero.NewOsFs()

AppFs is a wrapper to OS package

View Source
var ErrCannotInteractWithGit = errors.New("Cannot interact with Git")

ErrCannotInteractWithGit is returned when trying to interact with Git

View Source
var ErrCannotMoveDotfile = errors.New("Couldn't move dotfile")

ErrCannotMoveDotfile is returned when trying create or write without permissions

View Source
var ErrCannotStatFile = errors.New("Cannot open file")

ErrCannotStatFile occurs when stating a non-existing file

View Source
var ErrCannotSymlink = errors.New("Couldn't create symlink")

ErrCannotSymlink is returned when trying to create a Symlink and fails

View Source
var ErrDotfilesRepository = errors.New("dotfiles repository doesn't exists or is not reachable")

ErrDotfilesRepository is returned when failing to stat a repository

View Source
var ErrHTTPError = errors.New("Cannot reach endpoint")

ErrHTTPError is returned when failing to reach an endpoint with HTTP

View Source
var ErrJSONPayloadInvalidFormat = errors.New("Invalid JSON format")

ErrJSONPayloadInvalidFormat is returned when the JSON payload format is invalid

View Source
var ErrOperationNotPermitted = errors.New("Operation not permitted")

ErrOperationNotPermitted is returned when trying create or write without permissions

View Source
var IPCheckerURL = "http://httpbin.org/ip"

IPCheckerURL is the endpoint to call to get IP data

Functions

func Add

func Add(packageManager string, packages []string) (NewPMList []string, err error)

Add a package in env.yml.

func AddPackagesToEnvFile

func AddPackagesToEnvFile(packageManagerName string, packages []string)

AddPackagesToEnvFile adds packages to the env.yml file.

func CopyFile

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

CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.

func EnsureDotfilesDir

func EnsureDotfilesDir(dotfilesDirPath string) (err error)

EnsureDotfilesDir create the ~/.dotfiles directory if not exists.

func EnsureDotfilesRepository

func EnsureDotfilesRepository(dotfilesRepository string, dotfilesDirPath string) (err error)

EnsureDotfilesRepository create Dotfiles repository if not exists.

func ImportIntoDotfilesDir

func ImportIntoDotfilesDir(dotfilesToSave []string, dotfilesDirPath string) (err error)

ImportIntoDotfilesDir moves dotfiles into dotfiles directory and create symlinks.

func InstallPackages

func InstallPackages(PackageManager pm.PackageManager, packages []string)

InstallPackages installs listed CLI packages.

func MoveFile

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

MoveFile copies given src to dst and remove dst.

func PersistDotfiles

func PersistDotfiles(message string, dotfilesDirPath string) (err error)

PersistDotfiles local dotfiles to remote.

func Remove

func Remove(packageManager string, packages []string) (NewPMList []string, err error)

Remove a package in env.yml.

func RemovePackagesFromEnvFile

func RemovePackagesFromEnvFile(packageManagerName string, packages []string)

RemovePackagesFromEnvFile removes packages from the env.yml file.

func Restore

func Restore(OSPackageManager pm.PackageManager)

Restore installs Ian and configuration Ian's environment.

func Save

func Save(dotfilesToSave []string) (err error)

Save persists the dotfiles in distant repository.

func SetupDotFiles

func SetupDotFiles(dotfilesRepository string, dotfilesDirPath string)

SetupDotFiles ask and retrieve a dotfiles repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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