Skip to content

Retrieving a single file from a git repo? #98

Open
@lorengordon

Description

@lorengordon

Is go-getter able to retrieve a single file from a git repo? It appears to work fine when the source is a directory, but not when the source is a file.

It does create the target directory, but does not write the file.

$ ./go-getter github.com/hashicorp/go-getter//helper/url/url.go url
2018/01/29 16:12:51 Success!
$ cat url/url.go
cat: url/url.go: No such file or directory
$ ls -al url/url.go
ls: cannot access url/url.go: No such file or directory
$ ls -al url
total 0
drwxr-xr-x 2 ec2-user ec2-user   6 Jan 29 16:12 .
drwx------ 5 ec2-user ec2-user 124 Jan 29 16:12 ..

Also tried specifying the destination as a filename, but that just creates a directory named for the file:

$ ./go-getter github.com/hashicorp/go-getter//helper/url/url.go url/url.go
2018/01/29 16:21:36 Success!
$ ls -al url
total 0
drwxr-xr-x 3 ec2-user ec2-user  20 Jan 29 16:21 .
drwx------ 5 ec2-user ec2-user 124 Jan 29 16:12 ..
drwxr-xr-x 2 ec2-user ec2-user   6 Jan 29 16:21 url.go
$ ls -al url/url.go
total 0
drwxr-xr-x 2 ec2-user ec2-user  6 Jan 29 16:21 .
drwxr-xr-x 3 ec2-user ec2-user 20 Jan 29 16:21 ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions