mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2199 from alexlarsson/dm-docs
Add some docs for newly exported functions
This commit is contained in:
commit
5892c8e469
2 changed files with 5 additions and 0 deletions
|
@ -283,6 +283,8 @@ func collectFileInfo(sourceDir string) (*FileInfo, error) {
|
||||||
return root, nil
|
return root, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compare a directory with an array of layer directories it was based on and
|
||||||
|
// generate an array of Change objects describing the changes
|
||||||
func ChangesLayers(newDir string, layers []string) ([]Change, error) {
|
func ChangesLayers(newDir string, layers []string) ([]Change, error) {
|
||||||
newRoot, err := collectFileInfo(newDir)
|
newRoot, err := collectFileInfo(newDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -299,6 +301,7 @@ func ChangesLayers(newDir string, layers []string) ([]Change, error) {
|
||||||
return newRoot.Changes(oldRoot), nil
|
return newRoot.Changes(oldRoot), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compare two directories and generate an array of Change objects describing the changes
|
||||||
func ChangesDirs(newDir, oldDir string) ([]Change, error) {
|
func ChangesDirs(newDir, oldDir string) ([]Change, error) {
|
||||||
oldRoot, err := collectFileInfo(oldDir)
|
oldRoot, err := collectFileInfo(oldDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1051,6 +1051,8 @@ func quote(word string, buf *bytes.Buffer) {
|
||||||
buf.WriteString("'")
|
buf.WriteString("'")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take a list of strings and escape them so they will be handled right
|
||||||
|
// when passed as arguments to an program via a shell
|
||||||
func ShellQuoteArguments(args []string) string {
|
func ShellQuoteArguments(args []string) string {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
for i, arg := range args {
|
for i, arg := range args {
|
||||||
|
|
Loading…
Add table
Reference in a new issue