Running shell script in rails only outputs the 1 line

I’m trying to make a rails controller pull the latest content from a repo on bit bucket. To the most part this is a success the only issue I have whilst testing I can only seem to get the page to output the first line the script returns and that seems to not run the rest of the script any ideas

Here is my bash script

  • How to automate workflow in git?
  • pipe is returning empty string in bash in git for windows
  • Implement .gitignore behavior in a shell script?
  • Don't want to use double quotes when using git commit -a -m
  • Add items to git index efficiently
  • “${1-}” vs “$1”
  • #!/bin/bash -l
    GIT_REPO='IMAREPO'
    TMP_GIT_CLONE=TEMPPATH
    PUBLIC_WWW=SITEPATH
    
    if [ -d $TMP_GIT_CLONE ]; then
       rm -Rf $TMP_GIT_CLONE
    fi
    git clone $GIT_REPO $TMP_GIT_CLONE
    jekyll build --source $TMP_GIT_CLONE --destination $PUBLIC_WWW
    rm -Rf $TMP_GIT_CLONE
    exit
    

    and in the rails controller I am doing

    @result = %x[/var/srv/pulldevelopment.sh]
    

    Which in turn only out put a single line from the script which is

    Cloning into ‘/root/tmp/git/blah’…

  • How to use PyCharm as a GIT diff tool from the command line?
  • TFS/Git extensions seems to ignore .gitignore
  • How can I give read Access to everybody with gitolite
  • Why do I have to stash / commit my changes before switching branches?
  • git pull into a specific directory
  • Git push takes forever
  • One Solution collect form web for “Running shell script in rails only outputs the 1 line”

    Yes, this is expected. By default Git only prints progress status if stderr is connected to a TTY. You can reproduce this behavior in a terminal with:

    $ git clone $GIT_REPO 2>&1 | cat
    

    Pass --progress to always get progress status on the stderr stream. See git-clone(1).

    Git Baby is a git and github fan, let's start git clone.