"use strict";
// const AutoUpdate = require("cli-autoupdate");
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// // load package.json of the package you wish to update
// let pkg = require("../../package.json");
// const update = new AutoUpdate(pkg);
// update.on("update", () => console.log("started update"));
// update.on("finish", () => console.log("finished updating"));
var cp = __importStar(require("child_process"));
var logger_1 = require("./logger");
var PACKAGE_NAME = "rubberduck-native";
exports.installUpdate = function () {
    logger_1.log("starting update -->");
    var options = { shell: "/bin/zsh" };
    // const cmd = `/Users/arjun/.nvm/versions/node/v9.11.1/bin/npm install -g ${PACKAGE_NAME}`;
    var cmd = "echo $PATH";
    return new Promise(function (resolve, reject) {
        cp.exec(cmd, options, function (error, stdout, stderr) {
            resolve({ stdout: stdout, error: error, stderr: stderr });
        });
    });
};
