Skip to content

Commit

Permalink
fix ignoring .cgiignore file on server side
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Jun 16, 2020
1 parent 8240b90 commit 85889a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/project.go
Expand Up @@ -61,7 +61,7 @@ func (cfg *ProjectConfig) TarCommand() []string {
if len(cfg.Tar) > 0 {
return cfg.Tar
}
return []string{"tar", "zcf", "-", "."}
return []string{"tar", "zcf", "-"}
}

func (cfg *ProjectConfig) Credentials() (*syscall.Credential, error) {
Expand Down Expand Up @@ -359,10 +359,10 @@ func (project *Project) Download(ctx context.Context, uid string, tarGzBall io.W
return fmt.Errorf("no such app")
}
args := project.config.TarCommand()
ignoreFile := filepath.Join(project.Root(), CGIIgnore)
if _, err := os.Stat(ignoreFile); err == nil {
args = append(args, "--exclude-from", ignoreFile)
if _, err := os.Stat(filepath.Join(app.location, CGIIgnore)); err == nil {
args = append(args, "--exclude-from", CGIIgnore)
}
args = append(args, ".")
cmd := exec.CommandContext(ctx, args[0], args[1:]...)
cmd.Stderr = os.Stderr
cmd.Stdout = tarGzBall
Expand Down

0 comments on commit 85889a3

Please sign in to comment.