create-dolittle-microservice
Version:
[](https://github.com/dolittle-entropy/vanir/actions/workflows/build.yml) [](https://www.nuget.org/pack
37 lines • 1.33 kB
JavaScript
;
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Globals = void 0;
const path_1 = __importDefault(require("path"));
class Globals {
static set version(version) {
this._version = version;
}
static get version() {
if (!this._version) {
const packageJson = require(path_1.default.join(this.rootPath, 'package.json'));
this._version = packageJson.version;
}
return this._version || '';
}
static set rootPath(path) {
this._rootPath = path;
}
static get rootPath() {
if (!this._rootPath) {
let rootPath = path_1.default.dirname(require.resolve('create-dolittle-microservice'));
if (rootPath.endsWith('dist')) {
rootPath = path_1.default.join(rootPath, '..');
}
this._rootPath = rootPath;
}
console.log(`RootPath : ${this._rootPath}`);
return this._rootPath;
}
}
exports.Globals = Globals;
//# sourceMappingURL=Globals.js.map