1 | "use strict";
|
2 |
|
3 | var _child_process = require("child_process");
|
4 |
|
5 | var _path = _interopRequireDefault(require("path"));
|
6 |
|
7 | var _shelljs = require("shelljs");
|
8 |
|
9 | var _clusterConfigSettingsUtils = require("./clusterConfigSettingsUtils");
|
10 |
|
11 | var _consoleApplication = require("./Commons/consoleApplication");
|
12 |
|
13 | var _pathUtils = require("./Commons/pathUtils");
|
14 |
|
15 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16 |
|
17 | (0, _consoleApplication.runConsoleApplication)(async () => {
|
18 | const pathToCandyApiExecutableDir = await (0, _pathUtils.findPathToCandyApi)(__dirname);
|
19 | const pathToCandyApiSources = await (0, _pathUtils.findPathToCandyApiSources)(__dirname);
|
20 | (0, _shelljs.cp)("-R", _path.default.join(pathToCandyApiSources, "settings/Candy.defaultLocal/*"), pathToCandyApiExecutableDir);
|
21 |
|
22 | const candyApiConfigPath = _path.default.join(pathToCandyApiExecutableDir, "settings", "candy.api", "config");
|
23 |
|
24 | await (0, _clusterConfigSettingsUtils.updateClusterConfigConfigurationFile)(candyApiConfigPath, {
|
25 | ResourcesPath: _path.default.join(__dirname, "..", "..", "candy.resources"),
|
26 | ResourcesDefaultPath: _path.default.join(__dirname, "..", "..", "candy.resources"),
|
27 | KonturDomains: "*|*:*",
|
28 | ResourcesBuildServerUri: ""
|
29 | });
|
30 | (0, _child_process.spawn)(_path.default.join(pathToCandyApiExecutableDir, "Candy.Api.exe"), [], {
|
31 | cwd: pathToCandyApiExecutableDir,
|
32 | shell: true,
|
33 | detached: true
|
34 | });
|
35 | });
|
36 |
|
\ | No newline at end of file |