Previously the cmd util uses different strategies to open files based
on whether MacDown is currently running. This results in various
problems, the most prominent being that NSWorkspace cannot be used
to pass a path for files that do not exist.
This change unifies the opening strategy to always be based on
cross-application NSUserDefaults instead, and moves the open file
check from during application launch to application activation.
This makes the implementation simpler, and also solves the problem
aforementioned.
Fix#672.
This implements a preference-based file-opening scheme. When the
CLI utility is run, all file name arguments are resolved to
absolute URLs and stored in a user default key *under the master
Macdown application's namespace*, and then launch MacDown.
Everytime MacDown is launched, it checks the aforementioned user
default key, and open any documents in it, creating non-saved drafts
if necessary (for non-existing documents). This mimics the expected
behaviours for "normal" editors, like VIM, nano, etc.. The user
default key is reset to nil after the documents are opened.
Closed#35.
Added a new target to the project. This is a command line utility
launcher for MacDown. The command line utility allows users to symlink
to their /usr/local/bin folder. In this way users can open files with
MacDown from the command line.