mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-01 14:14:06 +00:00
Init command should remove any includeWikis definitions
The includeWikis references will otherwise be broken when the edition is copied.
This commit is contained in:
parent
886d648568
commit
3f6bf2452a
@ -23,7 +23,8 @@ var Command = function(params,commander) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Command.prototype.execute = function() {
|
Command.prototype.execute = function() {
|
||||||
var path = require("path"),
|
var fs = require("fs"),
|
||||||
|
path = require("path"),
|
||||||
editionName = this.params[0] || "empty";
|
editionName = this.params[0] || "empty";
|
||||||
// Check that we don't already have a valid wiki folder
|
// Check that we don't already have a valid wiki folder
|
||||||
if($tw.boot.wikiTiddlersPath) {
|
if($tw.boot.wikiTiddlersPath) {
|
||||||
@ -39,6 +40,11 @@ Command.prototype.execute = function() {
|
|||||||
if(!err) {
|
if(!err) {
|
||||||
this.commander.streams.output.write("Copied edition '" + editionName + "' to " + $tw.boot.wikiPath + "\n");
|
this.commander.streams.output.write("Copied edition '" + editionName + "' to " + $tw.boot.wikiPath + "\n");
|
||||||
}
|
}
|
||||||
|
// Tweak the tiddlywiki.info to remove any included wikis
|
||||||
|
var packagePath = $tw.boot.wikiPath + "/tiddlywiki.info",
|
||||||
|
packageJson = JSON.parse(fs.readFileSync(packagePath));
|
||||||
|
delete packageJson.includeWikis;
|
||||||
|
fs.writeFileSync(packagePath,JSON.stringify(packageJson,null,$tw.config.preferences.jsonSpaces));
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edit
|
|||||||
--init <edition>
|
--init <edition>
|
||||||
```
|
```
|
||||||
|
|
||||||
The "edition" defaults to ''empty''.
|
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@ -18,4 +17,9 @@ For example:
|
|||||||
tiddlywiki ./MyWikiFolder --init empty
|
tiddlywiki ./MyWikiFolder --init empty
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the init command will fail if the wiki folder does not exist, or is not empty.
|
Note:
|
||||||
|
|
||||||
|
* The "edition" defaults to ''empty''
|
||||||
|
* The init command will fail if the wiki folder does not exist, or is not empty
|
||||||
|
* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user