pre-push hook's tools are not accessible through SourceTree but work in CLI

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Severity 3 - Minor

      My issue is that pre-push hook is working well when push is made by CLI but it does not when SourceTree is making the push.

       

      SourceTree: 2.6.3 (134)

      SystemGit: 2.13.6

       

      Hook

      #!/bin/zsh# variables
      gifName=$(date +%H-%M-%S\ %d-%m-%y)
      gifFolderName="Gifs"
      gifDir="$gifFolderName"# create video
      videosnap -t 5 -p 'Low' --no-audio -w 0
      # convert to gif
      gifify -o newGif movie.mov
      rm movie.mov
      if [ ! -d $gifDir ]; then
      mkdir $gifDir
      fi
      mv newGif.gif "$gifDir/$gifName.gif"
      

       

       

      CLI output

      ~/Projects/setup master ⇡
      ❯ git push 
      Started capture...Captured 4.93 seconds of video to 'movie.mov'
      newGif.gif
      Counting objects: 3, done.
      Delta compression using up to 4 threads.
      Compressing objects: 100% (2/2), done.
      Writing objects: 100% (3/3), 287 bytes | 287.00 KiB/s, done.
      Total 3 (delta 1), reused 0 (delta 0)
      To ssh://my.repo:/home/user/repo/git/priv/setup
      01056a6..fe41aee master -> master~/Projects/setup master 9s
      ❯
      

       

      SourceTree output

      git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/master
      Pushing to ssh://my.repo:/home/user/repo/git/priv/setup
      .git/hooks/pre-push:15: command not found: videosnap
      .git/hooks/pre-push:17: command not found: gifify
      rm: movie.mov: No such file or directory
      mv: rename newGif.gif to Gifs/10-33-56 14-11-17.gif: No such file or directory
      error: failed to push some refs to 'ssh://my.repo:/home/user/repo/git/priv/setup'
      Completed with errors, see above
      

              Assignee:
              Unassigned
              Reporter:
              Deleted Account (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: