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