api

package
v0.0.6-a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "v0.0.5-a"
)

Variables

This section is empty.

Functions

func List

func List() map[*Denv]bool

TODO: Make a ls denv -> files

func Pull

func Pull(remote string, branch string) string

TODO: change the returns

func Push

func Push(remote string, branch string) string

func UserHome

func UserHome() string

Types

type Config

type Config struct {
	DenvHome    string
	IgnoreFile  string
	InfoFile    string
	RestoreDenv string
	PreScript   string
	PostScript  string
}
var Settings Config

type Denv

type Denv struct {
	Path   string
	Ignore map[string]bool
}

func Activate

func Activate(env string) (*Denv, error)

func Deactivate

func Deactivate() *Denv

Deactivate the current denv and restore it to the state before denv was active. Returns the name of the deactivated denv. Empty string if there was no denv to deactivate

func GetDenv

func GetDenv(name string) (*Denv, error)

Get a Denv that has already been created Nil, err if it hasn't been created yet

func NewDenv

func NewDenv(name string) *Denv

Create a new Denv Bootstrap the creation with the folder and default denvignore

func Snapshot

func Snapshot(name string) *Denv

func Which

func Which() *Denv

func (*Denv) Enter

func (d *Denv) Enter()

func (*Denv) Exit

func (d *Denv) Exit()

func (*Denv) Files

func (d *Denv) Files() (included []string, ignored []string, scripts []string)

TODO addd denv.AddFile(path) Paths of files in the Denv Definition Tells you which paths are currently included and ignored

func (*Denv) IsDenvFile

func (d *Denv) IsDenvFile(path string) bool

func (*Denv) IsIgnored

func (d *Denv) IsIgnored(path string) bool

Check to see if a file path be ignored by this Denv

func (*Denv) IsScript

func (d *Denv) IsScript(path string) bool

func (*Denv) LoadIgnore

func (d *Denv) LoadIgnore()

Loads the denvignore from disk

func (*Denv) MatchedFiles

func (d *Denv) MatchedFiles(root string) (included []string, ignored []string, scripts []string)

Given an arbitrary path, return which files would be included and which would be ignored. If path contains a folder, it will not be recursed into.

func (*Denv) Name

func (d *Denv) Name() string

Name of the denv

func (*Denv) SetDenvIgnore

func (d *Denv) SetDenvIgnore(path string)

func (*Denv) ToString

func (d *Denv) ToString() string

String representation of the denv

type DenvInfo

type DenvInfo struct {
	Current    *Denv
	Path       string
	Repository *git.Repository
}
var Info DenvInfo

func (*DenvInfo) Clear

func (d *DenvInfo) Clear()

func (*DenvInfo) Flush

func (d *DenvInfo) Flush()

func (*DenvInfo) IsActive

func (d *DenvInfo) IsActive() bool

func (*DenvInfo) Load

func (d *DenvInfo) Load()

func (*DenvInfo) ToString

func (d *DenvInfo) ToString() string

Jump to

Keyboard shortcuts

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