pkg

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOrCreateDir

func CheckOrCreateDir(path string) error

Create a certain directory if it doesn't exist

func Clone

func Clone(path string, repoName string, version string) error

Clone a certain github repository into a certain folder

func CreateNewPpmConfig

func CreateNewPpmConfig(path string) error

Create a new ppm.json file

func DoesPathExist

func DoesPathExist(path string) (bool, error)

Check wether an absolute path exists

func GetPluginName

func GetPluginName(name string) string

func GetVersionOrNot

func GetVersionOrNot(dependency string) (string, string)

func IndexOf

func IndexOf(target string, data []string) int

Get the index of a certain item in a string slice

func PlayLoadingAnim

func PlayLoadingAnim(loading chan interface{})

func PrintDone

func PrintDone()

func StringSliceContains

func StringSliceContains(target string, data []string) bool

Check wether a certain item exists in a string slice

func Update

func Update(path string) error

Update a certain repository

Types

type PpmConfig

type PpmConfig struct {
	Plugin          bool     `json:"plugin"`
	Dependencies    []string `json:"dependencies"`
	SubDependencies []string `json:"sub-dependencies"`
	// contains filtered or unexported fields
}

Representing a ppm.json configuration file

func GetPluginConfig

func GetPluginConfig(dirPath string, dependency string) (PpmConfig, error)

func ParsePpmConfig

func ParsePpmConfig(filePath string) (PpmConfig, error)

Parse the ppm.json file to an object

func (*PpmConfig) AddDependency

func (ppm *PpmConfig) AddDependency(dependency string)

Add an item safely to the Dependencies property

func (*PpmConfig) AddSubDependency

func (ppm *PpmConfig) AddSubDependency(dependency string)

Add an item safely to the sub-dependencies property

func (PpmConfig) HasDependency

func (ppm PpmConfig) HasDependency(dependency string) bool

Check wether the config file has a certain dependency

func (PpmConfig) HasSubDependency

func (ppm PpmConfig) HasSubDependency(dependency string) bool

Check wether the config file has a certain sub-dependency

func (PpmConfig) PrettyPrint

func (ppm PpmConfig) PrettyPrint()

func (*PpmConfig) RemoveAllDependencies

func (ppm *PpmConfig) RemoveAllDependencies()

Remove ALL (sub)dependencies

func (*PpmConfig) RemoveDependency

func (ppm *PpmConfig) RemoveDependency(dependency string)

Remove an item safely from the sub-dependencies property by its name

func (*PpmConfig) RemoveSubDependency

func (ppm *PpmConfig) RemoveSubDependency(dependency string)

Remove an item safely from the Dependencies property by its name

Jump to

Keyboard shortcuts

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