utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, slice2 []string) []string

It takes two slices and appends the second one onto the first one. It does not allow duplicates

func AppendIfMissingElem

func AppendIfMissingElem(slice []string, i string) []string

It takes in a slice and an element and then ut appends that element to the slice only if that element in not already in the slice

func CopyDir added in v0.3.2

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

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile added in v0.3.2

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

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func Difference added in v0.3.2

func Difference(a, b []string) []string

Eeturns elements in a that aren't in b

func IsAppType added in v0.3.2

func IsAppType(wioPath string) (bool, error)

Checks if the config file is of App type or Pkg type

func IsDir

func IsDir(path string) (bool, error)

Checks if the give path is a director and based on the returns true or false. If path does not exist, it throws an error

func IsEmpty

func IsEmpty(name string) (bool, error)

This checks if the directory is empty or not

func PathExists

func PathExists(path string) bool

Checks if path exists and returns true and false based on that

func PrettyPrintConfig

func PrettyPrintConfig(projectConfig types.Config, filePath string, showHelp bool) error

Write configuration with nice spacing and information

func ReadWioConfig added in v0.3.2

func ReadWioConfig(path string) (types.Config, error)

Read config file and return config object

Types

This section is empty.

Directories

Path Synopsis
Package io contains helper functions related to io This file contains all the utilities available to be used from copying files to reading JSON
Package io contains helper functions related to io This file contains all the utilities available to be used from copying files to reading JSON

Jump to

Keyboard shortcuts

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