"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = require("path");
const chalk = require("chalk");
const fs_1 = require("../utils/fs");
function getIonic1Version(env) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const ionicVersionFilePath = path.resolve(env.project.directory, 'www', 'lib', 'ionic', 'version.json'); // TODO
        try {
            const ionicVersionJson = yield fs_1.fsReadJsonFile(ionicVersionFilePath);
            return ionicVersionJson['version'];
        }
        catch (e) {
            env.log.error(`Error with ${chalk.bold(ionicVersionFilePath)} file: ${e}`);
        }
    });
}
exports.getIonic1Version = getIonic1Version;
