"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const path = require("path"); const chalk_1 = require("chalk"); function getIonicAngularVersion(env, project) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const { readPackageJsonFile } = yield Promise.resolve().then(() => require('@ionic/cli-framework/utils/npm')); const { prettyPath } = yield Promise.resolve().then(() => require('../utils/format')); const ionicAngularPackageJsonFilePath = path.resolve(project.directory, 'node_modules', 'ionic-angular', 'package.json'); // TODO try { const ionicAngularPackageJson = yield readPackageJsonFile(ionicAngularPackageJsonFilePath); return ionicAngularPackageJson.version; } catch (e) { env.log.error(`Error with ${chalk_1.default.bold(prettyPath(ionicAngularPackageJsonFilePath))} file: ${e}`); } }); } exports.getIonicAngularVersion = getIonicAngularVersion; function getAppScriptsVersion(env, project) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const { readPackageJsonFile } = yield Promise.resolve().then(() => require('@ionic/cli-framework/utils/npm')); const { prettyPath } = yield Promise.resolve().then(() => require('../utils/format')); const appScriptsPackageJsonFilePath = path.resolve(project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json'); // TODO try { const appScriptsPackageJson = yield readPackageJsonFile(appScriptsPackageJsonFilePath); return appScriptsPackageJson.version; } catch (e) { env.log.error(`Error with ${chalk_1.default.bold(prettyPath(appScriptsPackageJsonFilePath))} file: ${e}`); } }); } exports.getAppScriptsVersion = getAppScriptsVersion;