wiki-server 0.21.0-rc.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/search.coffee +17 -6
- package/package.json +2 -2
package/lib/search.coffee
CHANGED
|
@@ -37,9 +37,9 @@ module.exports = exports = (argv) ->
|
|
|
37
37
|
working = false
|
|
38
38
|
|
|
39
39
|
touch = (file, cb) ->
|
|
40
|
-
fs.stat
|
|
40
|
+
fs.stat file, (err, stats) ->
|
|
41
41
|
return cb() if err is null
|
|
42
|
-
fs.open
|
|
42
|
+
fs.open file, 'w', (err,fd) ->
|
|
43
43
|
cb(err) if err
|
|
44
44
|
fs.close fd, (err) ->
|
|
45
45
|
cb(err)
|
|
@@ -290,11 +290,22 @@ module.exports = exports = (argv) ->
|
|
|
290
290
|
if !err
|
|
291
291
|
try
|
|
292
292
|
testIndex = JSON.parse(data)
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
catch err
|
|
294
|
+
testIndex = {}
|
|
295
|
+
if testIndex.serializationVersion != 2
|
|
296
|
+
console.log "+++ SITE INDEX #{wikiName} : updating to latest version."
|
|
297
|
+
itself.createIndex pagehandler
|
|
298
|
+
# remove the update flag once the index has been created
|
|
299
|
+
itself.once 'indexed', ->
|
|
300
|
+
fs.unlink indexUpdateFlag, (err) ->
|
|
301
|
+
console.log "+++ SITE INDEX #{wikiName} : unable to delete update flag" if err
|
|
296
302
|
else
|
|
297
|
-
console.log "+++ SITE INDEX #{wikiName} : error reading index"
|
|
303
|
+
console.log "+++ SITE INDEX #{wikiName} : error reading index - attempting creating"
|
|
304
|
+
itself.createIndex pagehandler
|
|
305
|
+
# remove the update flag once the index has been created
|
|
306
|
+
itself.once 'indexed', ->
|
|
307
|
+
fs.unlink indexUpdateFlag, (err) ->
|
|
308
|
+
console.log "+++ SITE INDEX #{wikiName} : unable to delete update flag" if err
|
|
298
309
|
else
|
|
299
310
|
# index does not exist, so create it
|
|
300
311
|
itself.createIndex pagehandler
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wiki-server",
|
|
3
3
|
"description": "A Federated Wiki Server",
|
|
4
|
-
"version": "0.21.0
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ward Cunningham",
|
|
7
7
|
"email": "ward@c2.com",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"mocha": "^9.2.2",
|
|
54
54
|
"should": "^13.2.3",
|
|
55
55
|
"supertest": "^4.0.2",
|
|
56
|
-
"wiki-client": "^0.
|
|
56
|
+
"wiki-client": "^0.24.0",
|
|
57
57
|
"wiki-plugin-activity": "^0.4.6",
|
|
58
58
|
"wiki-plugin-video": "^0.2.10"
|
|
59
59
|
},
|