Jump to content

Recommended Posts

Hi all - I'm a brand new Alfred user and love it already, and would like to get some of the love going on around the company I work at.

 

I have a working bash script:

#!/bin/bash
cd $REPOS/$1
git checkout master
git pull
git checkout $2
git pull
git merge master
echo $PATH
CMD="mate ."
$CMD
Which works when I go to the directory and do ./script.sh [repo] [branch]
But converting it to
read repo branch <<< "{query}"
cd $REPOS/$repo
git checkout master
git pull
git checkout $branch
git pull
git merge master
CMD="mate ."
$CMD

And nothing happens.

 

Could someone help me out and tell me what am I missing here....?

 

Link to comment

I am assuming that the REPOS variable is defined in your bashrc file. Try sourcing you .bashrc file first. Many scripts have to do this to work properly.

 

To expound on this a little more.. Alfred doesn't import your environment so, variables, aliases, etc that you have created, including mods to $PATH aren't available in workflows by default. So you would need to source some of your files in order to import some things that you may need.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...