@data-fair/lib-node 2.10.2 → 2.11.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/package.json +1 -1
- package/upgrade-scripts.js +11 -2
package/package.json
CHANGED
package/upgrade-scripts.js
CHANGED
|
@@ -25,9 +25,18 @@ export default async function (db, locks, basePath = './', isFresh) {
|
|
|
25
25
|
}
|
|
26
26
|
async function runScripts(db, basePath, isFresh) {
|
|
27
27
|
const dir = path.resolve(basePath);
|
|
28
|
+
// in the case of workspaces the parent package.json is the right place to look for name and versions
|
|
29
|
+
const parentPjsonPath = path.join(dir, '../package.json');
|
|
28
30
|
const pjsonPath = path.join(dir, 'package.json');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
let pjson;
|
|
32
|
+
try {
|
|
33
|
+
pjson = JSON.parse(readFileSync(parentPjsonPath, 'utf8'));
|
|
34
|
+
debug('read service info from ' + parentPjsonPath);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
pjson = JSON.parse(readFileSync(pjsonPath, 'utf8'));
|
|
38
|
+
debug('read service info from ' + pjsonPath);
|
|
39
|
+
}
|
|
31
40
|
const scriptsRoot = path.join(dir, 'upgrade');
|
|
32
41
|
debug(`service=${pjson.name} version=${pjson.version}`);
|
|
33
42
|
const services = db.collection('services');
|