Oh I know the answer, just add path to first argument:

// If the first command line argument doesn't start with `--` then we
   // interpret it as the path to the wiki folder, which will otherwise 
default
   // to the current folder
   if($tw.boot.argv[0] && $tw.boot.argv[0].indexOf("--") !== 0) {
     $tw.boot.wikiPath = $tw.boot.argv[0];
     $tw.boot.argv = $tw.boot.argv.slice(1);
   } else {
     $tw.boot.wikiPath = process.cwd();
   }



在 2020年1月29日星期三 UTC+8下午6:15:20,LinOnetwo写道:
>
> I'd like to start server from %appData%/omnitiddly/tiddlywiki , but there 
> seem being no param in cli to do so, it can only start relative to PWD.
>
> I'm going to start tiddlywiki from electron app, so I'm going to do 
> something like this:
>
> const $tw = require('tiddlywiki/boot/boot.js').TiddlyWiki();
>
> // Pass the command line arguments to the boot kernel
> $tw.boot.argv = ['listen', '-path %appData%/omnitiddly/tiddlywiki'];
>
> // Boot the TW5 app
> $tw.boot.boot();
> Can I do so?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c1084d4f-c1b4-4ab5-ae6b-f021b3e0b3d6%40googlegroups.com.

Reply via email to