tag:support.markedapp.com,2011-09-11:/discussions/suggestions/45680-make-custom-processor-work-in-main-files-directoryMarked: Discussion 2016-02-15T15:44:42Ztag:support.markedapp.com,2011-09-11:Comment/391729052016-02-15T15:26:08Z2016-02-15T15:26:08ZMake custom processor work in main file's directory<div><p>When running shell commands from within an app bundle, I do not
have<br>
access to the user environment prior to running the command.
Marked<br>
sends the text to STDIN, and doesn't actually pass a file with
a<br>
location. This is why the environment variables were made available
to<br>
shell scripts.</p>
<p><a href="http://marked2app.com/help/Custom_Processor.html#environmentvariables">
http://marked2app.com/help/Custom_Processor.html#environmentvariables</a></p>
<p>A simple wrapper script that reads the $MARKED_ORIGIN variable
and<br>
performs a <code>cd</code> command prior to passing the text to
pandoc (`cat |<br>
pandoc [options]) should resolve the problem. It's really not an
option<br>
to handle this universally within Marked at this point, as every
custom<br>
processor setup will have different requirements.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/391729052016-02-15T15:44:40Z2016-02-15T15:44:41ZMake custom processor work in main file's directory<div><p>Thank you for your reply!</p>
<p>I do not agree that processor requirements are so unpredictably
different, especially with regard to the working directory. Being
run in the directory of the main file is quite a common assumption,
also for other programs like TeX or roff. (And Marked certainly
sees the path of the file that is sent to the processor's
STDIN.)</p>
<p>But of course I accept the reasoning that OS X is making running
programs the ‘normal’ (unixy) way (increasingly?)
difficult. ;-( Maybe, with my expectations, I should rather stick
to the more unixy programs.</p>
<p>Sorry for the noise, but thanks again for the quick
response,<br>
Bernhard</p></div>Bernhard