Skip to content

Instantly share code, notes, and snippets.

@thomasdegry
Created March 11, 2015 20:12
Show Gist options
  • Save thomasdegry/b9545450172ad0cacecb to your computer and use it in GitHub Desktop.
Save thomasdegry/b9545450172ad0cacecb to your computer and use it in GitHub Desktop.
Go code wait
func takePhoto() {
takePhotoCommand := exec.Command("./photo.sh")
result, err := takePhotoCommand.Output()
fmt.Println(string(result))
if err != nil {
panic(err)
} else {
fmt.Println("Phto was taken")
resetExifCommand := exec.Command("./reset-exif.sh")
resultRotation, errRotation := resetExifCommand.Output()
fmt.Println(string(resultRotation))
if errRotation != nil {
check(errRotation)
} else {
fmt.Println("Will upload photo")
uploadFileToTablet("photo.jpg")
fmt.Println("Did upload photo to tablet")
time.Sleep(10 * time.Second)
uploadFileToTablet("done.txt")
fmt.Println("Did upload done.txt to tablet")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment