#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const logger_js_1 = require("./logger.js");
const fileOperationHelper_js_1 = require("./fileOperationHelper.js");
const pathsConstants_js_1 = require("./pathsConstants.js");

module.exports = (function () {
    logger_js_1.default.logMessageSync("Starting instrumentation of React Native application ..", logger_js_1.default.INFO);
    showVersionOfPlugin();

    logger_js_1.default.logMessageSync("Finished instrumentation of React Native application ..", logger_js_1.default.INFO);
    logger_js_1.default.closeLogFile();
}());

function showVersionOfPlugin() {
    try {
        let packageJsonContent = fileOperationHelper_js_1.default.readTextFromFileSync(pathsConstants_js_1.default.getInternalPackageJsonFile());
        let packageJsonContentObj = JSON.parse(packageJsonContent);
        logger_js_1.default.logMessageSync("Cloudwise React Native Plugin - Version " + packageJsonContentObj.version, logger_js_1.default.INFO);
    }
    catch (e) {
        logger_js_1.default.logMessageSync("Cloudwise React Native Plugin - Version NOT READABLE", logger_js_1.default.WARNING);
    }
}
