Jump to content

Horttcore

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Horttcore

  1. Hello my name is Ralf and I'm from good old germany.

     

    I've written a dandelion ( git deployment ruby gem ) Workflow and would like to get some feedback, because I think I'm not doing it right :-)

    Here is some code

     

    dandelion deploy

    # Load profile
    cd ~/
    . .bash_profile
    
    # Load multiple parameters
    read PROJECT REVISION <<< "{query}"
    
    # Go to project folder
    cd ~/Sites/$PROJECT
    
    # run Dandelion
    RESPONSE=$(dandelion deploy $REVISION)
    
    # Notification
    echo $RESPONSE
    

    I'm loading the bash_profle because without it, it won't work as a "run script", as a terminal command it would run without it.

    This is due the missing enviroment variables in the "run script" part.

     

    The other commands are really basics.

     

    Is there a better way to handle this enviroment stuff? As I run often in this situation with other workflows I've written.

    Also I'm missing in Alfred something like a settings dialog for workflows.

     

    Cheers Ralf

     

    PS: Forgot to say, it works perfectly for me, but I still have the feeling that it could be better…

  2. Ok, thank you very much for the hint!

    Sad thing, it still don't work :-/

     

    That will result in:

     

    #!/bin/bash
     
    # VARS
    ROOT=~/Sites
     
    read PROJECT COMMAND <<< "{query}"
    # Go to project folder
    cd $ROOT/$PROJECT
     
    # Run WP-CLI command
    OUTPUT=$(/usr/bin/wp $COMMAND)
     
    # Post notification
    echo $OUTPUT
    
    Edit: Wow found the Debug button(!), now everything is much clearer!

    wp can't connect to the MySQL DB…

  3. Hello,

     

    I've build a Alfred Workflow for using WP-CLI. It works if I use Terminal Command, but I don't want to open a terminal window everytime I use the workflow. As already said the "Run Script" should work the same way as "Terminal Command" but it doesn't I have no clue what I'm doing wrong.

     

    I'm just a beginner so don't judge me too hard ;-)

     

    Terminal Command

    # VARS
    ROOT=~/Sites
    
    read PROJECT COMMAND <<< "{query}"
    
    # Go to project folder
    cd $ROOT/$PROJECT
    
    # Run WP-CLI command
    OUTPUT=$(wp $COMMAND)
    
    # Post notification
    echo $OUTPUT 
    
    /bin/bash

    #!/bin/bash
    
    # VARS
    ROOT=~/Sites
    
    read PROJECT COMMAND <<< "{query}"
    
    # Go to project folder
    cd $ROOT/$PROJECT
    
    # Run WP-CLI command
    OUTPUT=$(wp $COMMAND)
    
    # Post notification
    echo $OUTPUT
    
    Also the "Post Notification" is empty?! I thought {query} will output everything that was echoed.
×
×
  • Create New...