mirror of https://github.com/perkeep/perkeep.git
camput: Skip base directories where IsIgnoredFile() returns true.
camput currently panics if a base directory is ignored. Fixes issue 314. Change-Id: I9466b4576b1134994e5e53e1067e0435ddba0fdf
This commit is contained in:
parent
f6f7fb2ff3
commit
07a42aaa40
|
@ -230,6 +230,12 @@ func (c *fileCmd) RunCommand(args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Skip ignored files or base directories. Failing to skip the
|
||||
// latter results in a panic.
|
||||
if up.Client.IsIgnoredFile(filename) {
|
||||
log.Printf("Client configured to ignore %s; skipping.", filename)
|
||||
continue
|
||||
}
|
||||
if fi.IsDir() {
|
||||
if up.fileOpts.wantVivify() {
|
||||
vlog.Printf("Directories not supported in vivify mode; skipping %v\n", filename)
|
||||
|
@ -239,9 +245,6 @@ func (c *fileCmd) RunCommand(args []string) error {
|
|||
t.Start()
|
||||
lastPut, err = t.Wait()
|
||||
} else {
|
||||
if up.Client.IsIgnoredFile(filename) {
|
||||
continue
|
||||
}
|
||||
lastPut, err = up.UploadFile(filename)
|
||||
if err == nil && c.deleteAfterUpload {
|
||||
if err := os.Remove(filename); err != nil {
|
||||
|
|
Loading…
Reference in New Issue