Skip to content

Instantly share code, notes, and snippets.

@aaronmoodie
Forked from hongymagic/README.md
Created September 2, 2012 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronmoodie/3605724 to your computer and use it in GitHub Desktop.
Save aaronmoodie/3605724 to your computer and use it in GitHub Desktop.
Simple zsh wrapper to launch iA Writer from the terminal

This is a simple script to launch iA Writer from the terminal. It is extremely useful for interacting with Github's own wiki system as it provides git access.

INSTALL

One-liner

curl -L https://raw.github.com/gist/3605724/efcccacb59e5df271ddf603ac92da4deee2440df/ia > /usr/local/bin/ia && chmod u+x /usr/local/bin/ia

Manual, safer way

  1. Copy the script below to /usr/local/bin (or anywhere else where you store your custom executables)
  2. Make it executable: chmod u+x /usr/local/bin/ia

Usage

Simple launch

$ ia

Launch and open a file

$ ia Home.md

Launch multiple files

$ ia Home.md About.md FAQ.md
#!/bin/zsh
for FILE in "$@"
do
if [ -e "$FILE" ]; then
open -a "iA Writer" "$FILE"
else
touch "$FILE"
open -a "iA Writer" "$FILE"
fi
done;
@aaronmoodie
Copy link
Author

edited to check if file/s exist and create if not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment