1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const main_1 = require("./main");
|
4 |
|
5 | async function realm_check(realm) {
|
6 | const project = await main_1.getCurrentProject();
|
7 | if (realm.project !== project) {
|
8 | throw new Error(`Realm ${realm.name} with Context ${realm.context} should have project ${realm.project} but has ${project}
|
9 | Do a 'npm run vdev realm ${realm.name}' to make sure all is set correctly`);
|
10 | }
|
11 | }
|
12 | exports.realm_check = realm_check;
|
13 | async function realm_set_begin(realm, currentRealm) {
|
14 | const project = await main_1.getCurrentProject();
|
15 | if (realm.project && realm.project !== project) {
|
16 | await main_1.setCurrentProject(realm.project);
|
17 | return true;
|
18 | }
|
19 | return false;
|
20 | }
|
21 | exports.realm_set_begin = realm_set_begin;
|
22 |
|