Merge pull request #6362 from medyagh/kic_del

implement remove file for kic runner
pull/6369/head
Thomas Strömberg 2020-01-22 06:04:21 -08:00 committed by GitHub
commit 8562d1c82d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -169,7 +169,11 @@ func (k *kicRunner) Copy(f assets.CopyableFile) error {
// Remove removes a file
func (k *kicRunner) Remove(f assets.CopyableFile) error {
return fmt.Errorf("not implemented yet for kic runner")
fp := path.Join(f.GetTargetDir(), f.GetTargetName())
if rr, err := k.RunCmd(exec.Command("sudo", "rm", fp)); err != nil {
return errors.Wrapf(err, "removing file %q output: %s", fp, rr.Output())
}
return nil
}
// isTerminal returns true if the writer w is a terminal