Merge pull request #17 from fmpwizard/patch-1

If fetcher is disabled, don't test to move files
master
Jaime Pillora 2017-07-28 02:12:24 +10:00 committed by GitHub
commit aefa2b61eb
1 changed files with 7 additions and 5 deletions

View File

@ -90,11 +90,13 @@ func (mp *master) checkBinary() error {
mp.binHash = hash.Sum(nil)
f.Close()
//test bin<->tmpbin moves
if err := move(tmpBinPath, mp.binPath); err != nil {
return fmt.Errorf("cannot move binary (%s)", err)
}
if err := move(mp.binPath, tmpBinPath); err != nil {
return fmt.Errorf("cannot move binary back (%s)", err)
if mp.Config.Fetcher != nil {
if err := move(tmpBinPath, mp.binPath); err != nil {
return fmt.Errorf("cannot move binary (%s)", err)
}
if err := move(mp.binPath, tmpBinPath); err != nil {
return fmt.Errorf("cannot move binary back (%s)", err)
}
}
return nil
}