Skip to content

Commit

Permalink
Provide an option for the load command to not error if no tiddlers ar…
Browse files Browse the repository at this point in the history
…e found
  • Loading branch information
Jermolene committed Mar 8, 2019
1 parent 07635d7 commit 12630d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/language/en-GB/Help/load.tid
Expand Up @@ -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:

```
Expand Down
2 changes: 1 addition & 1 deletion core/modules/commands/load.js
Expand Up @@ -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);
Expand Down

0 comments on commit 12630d4

Please sign in to comment.