"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const command_1 = require("@oclif/command");
const reload_1 = tslib_1.__importDefault(require("./reload"));
const base_1 = tslib_1.__importDefault(require("../base"));
const logger_1 = tslib_1.__importDefault(require("../utils/logger"));
const git_1 = require("../utils/git");
const constants_1 = require("../constants");
class Pull extends base_1.default {
    async run() {
        const { flags } = this.parse(Pull);
        this.userConfig = Object.assign(this.userConfig, flags);
        const remotes = await git_1.git.getRemotes(false);
        await git_1.git.checkout(constants_1.TUTURE_BRANCH);
        await git_1.git.pull(remotes[0].name, constants_1.TUTURE_BRANCH);
        // Commit changes to tuture branch.
        logger_1.default.log('success', 'Pulled to local.');
        await reload_1.default.run([]);
    }
}
exports.default = Pull;
Pull.description = 'Pull the remote tuture branch to local';
Pull.flags = {
    help: command_1.flags.help({ char: 'h' }),
};
