mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Provide an option for the load command to not error if no tiddlers are found
This commit is contained in:
parent
07635d7b3e
commit
12630d4a91
@ -4,10 +4,12 @@ description: Load tiddlers from a file
|
||||
Load tiddlers from TiddlyWiki (`.html`), `.tiddler`, `.tid`, `.json` or other local files. The processing applied to incoming files is determined by the file extension. Use the alternative `import` command if you need to specify the deserializer and encoding explicitly.
|
||||
|
||||
```
|
||||
--load <filepath>
|
||||
--load <dirpath>
|
||||
--load <filepath> [noerror]
|
||||
--load <dirpath> [noerror]
|
||||
```
|
||||
|
||||
By default, the load command raises an error if no tiddlers are found. The error can be suppressed by providing the optional "noerror" parameter.
|
||||
|
||||
To load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example:
|
||||
|
||||
```
|
||||
|
@ -38,7 +38,7 @@ Command.prototype.execute = function() {
|
||||
count++;
|
||||
});
|
||||
});
|
||||
if(!count) {
|
||||
if(!count && self.params[1] !== "noerror") {
|
||||
self.callback("No tiddlers found in file \"" + self.params[0] + "\"");
|
||||
} else {
|
||||
self.callback(null);
|
||||
|
Loading…
Reference in New Issue
Block a user