Jump to content

stouty

Member
  • Posts

    29
  • Joined

  • Last visited

Posts posted by stouty

  1.  

    5/16/13 8:10:57.821 PM Alfred Workflow[4882]: ERROR: git is NOT installed, cannot continue
     

    but when I type git in terminal:

     

     

    Macintosh:bin $ git
    usage: git [--version] [--help] [-c name=value]
               [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
               [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
               [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
               <command> [<args>]
     
    <snip>
     
    See 'git help <command>' for more information on a specific command.

     

     

     

    I think your git command is not in the path inherited by the Alfred process

     

    Can you type in a Terminal and post the results

    echo $PATH
    which git
    type -P git
    type -ap git

    Then in Alfred create a new blank workflow, say hotkey to script, oh hold on ... here, try this:

     

    getGitPath.alfredworkflow

     

    See what the output is (it's posted as a large type notification and copied to the clipboard for you to paste in here)

     

    For me:

     

     

    $ echo $PATH
    /Users/james/.rbenv/shims:/Users/james/.rbenv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/james/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/james/Projects/Scripts:/Users/james/Scripts
    
    $ which git
    /usr/local/bin/git
    
    $ type -P git
    /usr/local/bin/git
    
    $ type -ap git
    /usr/local/bin/git
    /usr/bin/git
    /usr/local/bin/git

    The from the workflow:

     

     

    PATH = /usr/bin:/bin:/usr/sbin:/sbin
    which git = [/usr/bin/git]

    So the Cheaters workflow works for me as I have two gits installed.

     

    Two options:

     

    1. I add a load of paths to the Info.plist and export them. e.g. 

     

     

    export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin
     
    resulting from getGitPath.alfredworkflow in:

     

    PATH = /usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin
    which git = [/usr/local/bin/git]
    2. I spend a little time finding the right git in my workflow.
     
    I'll opt for 2 and submit an update, but I'd like to see your output if possible to make sure I am thinking along the right lines.
     
    thanks
    James
     

     

     

     

     

     

     

     

  2. I am having an Error with cheaters.

    "ERROR /Users/me/Library/Application Support/Alfred 2/Alfred.alfre..."

     

    I've placed the cheaters folder as you told.

     

    Wait, did you move the cheaters directory manually? I don't see the .git folder in your cheaters folder.

     

    See mine:

     

    git.png

     

     

    Have you made any edits to index.html? If so, copy it somewhere safe, then delete the cheaters dir, and re-run the workflow, then copy your edited index.html back, and run git commit -m 'my changes' on the terminal. Only if you changed index.html, otherwise just delete and re-run the workflow.

  3. I am having an Error with cheaters.

    "ERROR /Users/me/Library/Application Support/Alfred 2/Alfred.alfre..."

     

    I've placed the cheaters folder as you told.

     

    What's the full error? Can you check your console.app log? Open /Applications/Utilities/Console.app then run the workflow and look in system.log for "Alfred Workflow" errors.

  4. Hit your hotkey and Cheaters will appear in a web-popup.

     

    Cheaters is a customizable cheat sheet system for OS X written by Brett Terpstra.

     

    cheat.jpeg

     

     

    Dependencies
     
    Git (I tested with v1.7.12.4 and v1.8.2.1)
     
    System Modifications
     
    Downloads the Cheaters source code into ${HOME}/Library/Application Support/Alfred 2/Workflow Data/com.stouty.cheaters/cheaters directory. It's NOT deleted if you delete the workflow.
     

    Download

     

    v1.3 - Cheaters.alfredworkflow

     

    UPDATE: 19th May 2013

     

    v1.5 - Cheaters.alfredworkflow - Updated Git workflow and improved PATH search

     

     

    Source code

     

    Blog Post

     

    To-Do

    • Find more elegant solution to the Automator Launcher spinning gear icon hack. I tried this as both an Automator workflow and an application, both spawn the spinning gear. If everyone had Bartender, the spinning gear could be hidden by Bartender and there would be no need for the two workflows. Suggestions welcome!
    • Update Cheaters git repo from origin/upstream master.
    • Show progress indicator when cloning/updating.
    • DONE: Implement update logic. I should have put the git repo in ~/Library/Application Support/Alfred 2/Workflow Data/$bundle_id. As it is now, the Cheaters git repo is wiped out when you install a new version of the workflow.
    • DONE: Make Alleyoop compatible.
  5. @stouty The advantage of having YYYYMMDD at the end of the filename is a sort by name will also sort similar files by date. 

     

    The original workflow used date created .. I actually meant the current timestamp. What do you think people would prefer?

  6. @stouty The advantage of having YYYYMMDD at the end of the filename is a sort by name will also sort similar files by date. 

     

    I'll change it so YYYYMMDD is the default. I've been working on a way for the user to choose from some defaults or add their own

  7. /Volumes/*/.Trashes
     

     

     

    Probably need sudo privileges to get at all files though.

     

    I have an alias:

     

     

     

    alias emptytrash='sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl'
     

    but that of course prompts me for my password. 

     

    Anyone know of a way to get sudo privs in a workflow? NOPASSWD=/bin/rm  and ssh to localhost with authkeys? ... poor security though.

  8. It it possible to make this output the following format;

     

     

    2013-03-25 08-46 PM
     
    I'd like to insert "2013-03-25 08-46 PM" before the file name, I find it's better for sorting and finding files.
     
    I tried it myself, but I failed as it was in Automator and I have no coding skills whatsoever (even though one might argue Automator doesn't require any.)
     
    I have another extension I found from some one using bash to copy the date and time to the clipboard. I was able to modify that script for the above format. Since this is an automator action, I tried everything I could think of, I just fail in coding.
     
    If not, no worries, right now I just manually replace the filename or I save it correctly at the time of creation. I also use the current date and time, not the created date.
     
    Regardless, thanks, always appreciate new workflows.

     

    Here you go: Add Date and Time Before Filename.alfredworkflow

     

    Only tested briefly, so let me know if you have any issues.

  9. Nice. Although I did modify the Automater workflow to use a YYYYMMDD format. I find this format much better for filenames.

     

    Yes, I'd like to re-write so it takes options for the date/time format and insert location. Easier to re-write as a shell script I think if I want that.

×
×
  • Create New...