Jump to content

Search the Community

Showing results for tags 'wp-cli'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 2 results

  1. First, I really apologise for how incompetent I am. Without Google, I'd never be able to do anything. But even with Google, I fail. Basic principles, var, query, just fly right over my head. Doesn't matter how much I concentrate, and how much I read, I just never seem to get it I'm trying to construct an Alfred workflow to do the following: I want to create a command consisting of three elements: 1. wp-clone 2. site1 3. site2 #1 is constant. #2 and #3 are variables. They are basically source-folder, destination-folder. The names would change in real use. I'm just using "site1" and "site2" here to illustrate. The final command, which I'd like to pass to iTerm.app, would look like this: wp-clone site1 site2 So what would be ideal is if I can: 1. Pull up the Alfred window (option-space) and start typing "Valet Clone". Press return and it auto-completes (like a keyword would) 2. On return a space inserts and I enter the first argument, where I input "site1" (without quotes: it's basically a directory name) 3. Return again and I get to insert another input, "site2" (again, without quotes: the second directory) 4. Return again and these two variables or arguments are put together and formed as the command: wp-clone site1 site2 It would be great, at that point, if I can run this in the background. Something like: export PATH=/usr/local/bin:$PATH cd /Users/Decline/SERVER/ && wp-clone {query1} {query2} (I would need PATH included as "wp-clone" is a command Alfred's command line wouldn't recognise.) However, I don't mind if the next stage is simply to open iTerm.app and paste the combined command there. The big problem I have is knowing how on earth to get those two variables (site1 and site1) into a single command, and in an elegant way in Alfred's GUI. I just can't wrap my head around it Attached is an attempt, which doesn't work at all, to hack something together in a workflow. Can someone point me in the right direction? Please, any input, imagine you're speaking to a small child, or a Golden Retriever. Many thanks in advance, ian My lame attempt (junk, doesn't work): Valet Clone Alfred Workflow
  2. Hi guys and gals! First of all I'd like to thank you all for the past workflows I downloaded and for all the help I found on this forum! ;-) Please note i'm a newbie in workflows and bash stuff! I am working on a workflow for WP-CLI (http://wp-cli.org/). The aim of that script is to easily install a WordPress site in the following folder Applications/MAMP/htdocs/Dropbox. It has two parameters, the site slug and the site name. The problem I'm facing is that if I run the script from the Terminal, it works fine, but from the workflow it fails. What I have done: - installed WP-CLI (it works from the Terminal) - created a bash script - placed that .sh file in Applications/MAMP/htdocs/Dropbox - placed a .bash_profile file in users/remi/ - created the workflow to load the .sh file The .bash_profile file content is (required when using MAMP): # FIX PHP MAMP for WP-CLI export PATH=/Applications/MAMP/bin/php/php5.6.1/bin:$PATH export PATH=$PATH:/Applications/MAMP/Library/bin/ What works: - in the terminal the following command does work: cd Applications/MAMP/htdocs/Dropbox bash myscript.sh sitename "My WP Blog" It downloads latest WordPress version, create the sitename folder in Applications/MAMP/htdocs/Dropbox, etc... in other words, that works! What fails: - launching the myscript.sh file from Alfred 2 workflow. - the error message that I get in the debug console of Alfred is: [ERROR: alfred.workflow.action.script] Code 127: /Applications/MAMP/htdocs/Dropbox/myscript.sh: line 97: wp: command not found Here is my workflow content: bash /Applications/MAMP/htdocs/Dropbox/myscript.sh {query} And here is the beginning of my myscript.sh file: #!/bin/bash # # How to launch script ? # bash myscript.sh sitename "My WP Blog" # $1 = folder name & database name # $2 = Site title # VARS # admin email email="my@email.com" # local url login # --> Change to fit your server URL model (eg: http://localhost:8888/my-project) url="http://"$1"/" # admin login admin="admin-$1" # path to install your WPs pathtoinstall="/Applications/MAMP/htdocs/Dropbox/" # path to plugins.txt (not accurate, but the script fails before it's used!) pluginfilepath="/Desktop/plugins.txt" # end VARS --- # =============== # = Fancy Stuff = # =============== # not mandatory at all # Stop on error set -e # colorize and formatting command line # You need iTerm and activate 256 color mode in order to work : http://kevin.colyar.net/wp-content/uploads/2011/01/Preferences.jpg green='\x1B[0;32m' cyan='\x1B[1;36m' blue='\x1B[0;34m' grey='\x1B[1;30m' red='\x1B[0;31m' bold='\033[1m' normal='\033[0m' # Jump a line function line { echo " " } # Sript has something to say function bot { line echo -e "${blue}${bold}( script says )${normal} $1" } # ============================== # = The show is about to begin = # ============================== # Welcome ! bot "${blue}${bold}Hi!${normal}" echo -e " I am about to install the following WordPress site : ${cyan}$2${normal}" # CHECK : Directory doesn't exist # go to wordpress installs folder # --> Change : to wherever you want cd $pathtoinstall # check if provided folder name already exists if [ -d $1 ]; then bot "${red}Folder ${cyan}$1${red} already exists${normal}." echo " I am not going any further!" line # quit script exit 1 fi # create directory bot "Creating folder : ${cyan}$1${normal}" mkdir -p -m 777 $1 cd $1 # Download WP bot "I am downloading WordPress..." wp core download --force // and the script continues, but it fails at 1st wp call If I run the workflow, only the sitename folder is created in Applications/MAMP/htdocs/Dropbox and the first wp occurence breaks the process. So, i'm definitely missing something, but I don't know why. Any inputs on this would be highly appreciated. Of course I'll share the full workflow here, once it will be working. I'm open to any ideas and criticism! ;-)
  • Create New...