stouty Posted April 13, 2013 Share Posted April 13, 2013 (edited) 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. 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. Edited May 18, 2013 by stouty BabyAzerty 1 Link to comment
BabyAzerty Posted April 14, 2013 Share Posted April 14, 2013 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. Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 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. Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 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: 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. Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 I wonder if it's a bash version issue? Could you run type -a bash which bash bash --version In your Terminal? thanks Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 Could you try this debug version? It writes some info to a file on your Desktop -> ~/Desktop/Cheaters_DEBUG.txt Could you send me the file if you have chance? thanks James Link to comment
BabyAzerty Posted April 14, 2013 Share Posted April 14, 2013 Hi stouty ! Here is what tells me the console log 14/04/13 23:37:07,813 Alfred Workflow[1006]: ERROR: /Users/jeromepasquier/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.9E20A77E-5513-4FC2-9C7D-C89152F3D59B/Cheaters.workflow NOT found, cannot continue When I download the zip from github, there is no .git folder. Do I have to clone it ? I typed the 3 lines in the terminal and this is what it says : $ type -a bashbash is /bin/bash$ which bash/bin/bash$ bash --versionGNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)Copyright © 2007 Free Software Foundation, Inc. And finally, here is the DEBUG.txt https://dl.dropboxusercontent.com/u/7825376/Cheaters_DEBUG.txt Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 Ah, found the bug. New version here. Hope that one works. Link to comment
BabyAzerty Posted April 14, 2013 Share Posted April 14, 2013 Hmmm... 15/04/13 00:53:32,506 Alfred Workflow[1365]: ERROR: NOT a git repo I had to clone it to get the .git. Then I replaced the cheater folder with the new one from the clone. But then a pop up appeared asking me to do override something about LOCAL files. I said yes. Then a notification appeared : HEAD is now at 03322a4 add siri to demo ... And after calling the workflow, I have this error: ERROR the workflow file does not exist. /Users/foobar/Library/Application Support/Alfred 2/Alfred.alfre... Very strange =/ Link to comment
stouty Posted April 14, 2013 Author Share Posted April 14, 2013 Delete the /Users/jeromepasquier/Library/Application Support/Alfred 2/Workflow Data/com.stouty.cheaters/cheaters directory, then re-run. It should do the clone for you. Link to comment
twinpeaks Posted April 15, 2013 Share Posted April 15, 2013 I'm having the same exact errors as BabyAzerty, every error he/she has encountered has been the same for me. I don't know why, but I just tried your latest version from git hub as of this post time... Thanks anyhow! Hopefully it works for some people. Link to comment
BabyAzerty Posted April 15, 2013 Share Posted April 15, 2013 Hey stouti ! I did deleted the cheaters directory and re-run. It clone it for me. However I still have the same error ERROR the workflow file does not exist. /Users/foobar/Library/Application Support/Alfred 2/Alfred.alfre... ='( Link to comment
stouty Posted April 16, 2013 Author Share Posted April 16, 2013 Apologies for the issues. I think I've fixed it now. New version here. [link in original post also updated] BabyAzerty 1 Link to comment
BabyAzerty Posted April 16, 2013 Share Posted April 16, 2013 Hi Stouty ! This time is the RIGHT one ! You are great ! Thank you =) Link to comment
jeffmilton Posted May 17, 2013 Share Posted May 17, 2013 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>] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty Git repository or reinitialize an existing one log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects rebase Forward-port local commits to the updated upstream head reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed with GPG See 'git help <command>' for more information on a specific command. Macintosh:bin jeffmilton$ 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>] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty Git repository or reinitialize an existing one log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects rebase Forward-port local commits to the updated upstream head reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed with GPG See 'git help <command>' for more information on a specific command. Link to comment
stouty Posted May 17, 2013 Author Share Posted May 17, 2013 (edited) 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 Edited May 17, 2013 by stouty Link to comment
stouty Posted May 18, 2013 Author Share Posted May 18, 2013 (edited) Updated to v1.5 - Improved Git workflow and improved PATH search Update via Alleyoop or manual download: Cheaters.alfredworkflow Let me know if that sorts things out for you. thanks Edited May 18, 2013 by stouty Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now