UI for Zipcoin Blue

utils.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const tslib_1 = require("tslib");
  4. const path = require("path");
  5. const chalk_1 = require("chalk");
  6. function getIonicAngularVersion(env, project) {
  7. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  8. const { readPackageJsonFile } = yield Promise.resolve().then(() => require('@ionic/cli-framework/utils/npm'));
  9. const { prettyPath } = yield Promise.resolve().then(() => require('../utils/format'));
  10. const ionicAngularPackageJsonFilePath = path.resolve(project.directory, 'node_modules', 'ionic-angular', 'package.json'); // TODO
  11. try {
  12. const ionicAngularPackageJson = yield readPackageJsonFile(ionicAngularPackageJsonFilePath);
  13. return ionicAngularPackageJson.version;
  14. }
  15. catch (e) {
  16. env.log.error(`Error with ${chalk_1.default.bold(prettyPath(ionicAngularPackageJsonFilePath))} file: ${e}`);
  17. }
  18. });
  19. }
  20. exports.getIonicAngularVersion = getIonicAngularVersion;
  21. function getAppScriptsVersion(env, project) {
  22. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  23. const { readPackageJsonFile } = yield Promise.resolve().then(() => require('@ionic/cli-framework/utils/npm'));
  24. const { prettyPath } = yield Promise.resolve().then(() => require('../utils/format'));
  25. const appScriptsPackageJsonFilePath = path.resolve(project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json'); // TODO
  26. try {
  27. const appScriptsPackageJson = yield readPackageJsonFile(appScriptsPackageJsonFilePath);
  28. return appScriptsPackageJson.version;
  29. }
  30. catch (e) {
  31. env.log.error(`Error with ${chalk_1.default.bold(prettyPath(appScriptsPackageJsonFilePath))} file: ${e}`);
  32. }
  33. });
  34. }
  35. exports.getAppScriptsVersion = getAppScriptsVersion;