Ejemplo n.º 1
0
        protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            var flowDialog = new FlowDialog();

            if (flowDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var versionTag = string.IsNullOrEmpty(flowDialog.GitConfig.TagPrefix) ? "\"\"" : flowDialog.GitConfig.TagPrefix;

            /* 1. Add GitFlow config options
             * 2. Checkout develop branch (create if it doesn't exist, reset if it does)
             * 3. Push develop branch
             */
            var process = await ProcessHelper.StartProcessGui(
                "cmd.exe",
                $"/c cd \"{await FileHelper.GetSolutionDir()}\" && " +
                await GitHelper.GetSshSetup() +
                GitHelper.FormatCliCommand($"config --add gitflow.branch.master {flowDialog.GitConfig.MasterBranch}") +
                GitHelper.FormatCliCommand($"config --add gitflow.branch.develop {flowDialog.GitConfig.DevelopBranch}") +
                GitHelper.FormatCliCommand($"config --add gitflow.prefix.feature {flowDialog.GitConfig.FeaturePrefix}") +
                GitHelper.FormatCliCommand($"config --add gitflow.prefix.release {flowDialog.GitConfig.ReleasePrefix}") +
                GitHelper.FormatCliCommand($"config --add gitflow.prefix.hotfix {flowDialog.GitConfig.HotfixPrefix}") +
                GitHelper.FormatCliCommand($"config --add gitflow.prefix.versiontag {versionTag}") +
                (await GitHelper.RemoteBranchExists(flowDialog.GitConfig.DevelopBranch) ?
                 "echo." :
                 GitHelper.FormatCliCommand($"checkout -b {flowDialog.GitConfig.DevelopBranch}", false)),
                "Initializing GitFlow"
                );

            process.WaitForExit();
        }
Ejemplo n.º 2
0
        private void InitCommand(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(EnvHelper.SolutionDir))
            {
                return;
            }

            var flowDialog = new FlowDialog();

            if (flowDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var versionTag = string.IsNullOrEmpty(flowDialog.GitConfig.TagPrefix) ? "\"\"" : flowDialog.GitConfig.TagPrefix;

            /* 1. Add GitFlow config options
             * 2. Checkout develop branch (create if it doesn't exist, reset if it does)
             * 3. Push develop branch
             */
            var process = ProcessHelper.StartProcessGui(
                "cmd.exe",
                $"/c cd \"{EnvHelper.SolutionDir}\" && " +
                GitHelper.GetSshSetup() +
                FormatCliCommand($"config --add gitflow.branch.master {flowDialog.GitConfig.MasterBranch}") +
                FormatCliCommand($"config --add gitflow.branch.develop {flowDialog.GitConfig.DevelopBranch}") +
                FormatCliCommand($"config --add gitflow.prefix.feature {flowDialog.GitConfig.FeaturePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.release {flowDialog.GitConfig.ReleasePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.hotfix {flowDialog.GitConfig.HotfixPrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.versiontag {versionTag}") +
                (GitHelper.RemoteBranchExists(flowDialog.GitConfig.DevelopBranch) ?
                 "echo." :
                 FormatCliCommand($"checkout -b {flowDialog.GitConfig.DevelopBranch}", false)),
                "Initializing GitFlow"
                );

            process.WaitForExit();

            EnvHelper.GetGitConfig();
            EnvHelper.GetBranchName();
        }
Ejemplo n.º 3
0
        private void InitCommand(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(EnvHelper.SolutionDir)) return;

            var flowDialog = new FlowDialog();
            if (flowDialog.ShowDialog() != DialogResult.OK) return;

            /* 1. Add GitFlow config options
                 * 2. Checkout develop branch (create if it doesn't exist, reset if it does)
                 * 3. Push develop branch
                 */
            var process = ProcessHelper.StartProcessGui(
                "cmd.exe",
                $"/c cd \"{EnvHelper.SolutionDir}\" && " +
                GitHelper.GetSshSetup() +
                FormatCliCommand($"config --add gitflow.branch.master {flowDialog.FlowOptions.MasterBranch}") +
                FormatCliCommand($"config --add gitflow.branch.develop {flowDialog.FlowOptions.DevelopBranch}") +
                FormatCliCommand($"config --add gitflow.prefix.feature {flowDialog.FlowOptions.FeaturePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.release {flowDialog.FlowOptions.ReleasePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.hotfix {flowDialog.FlowOptions.HotfixPrefix}") +
                (GitHelper.RemoteBranchExists(flowDialog.FlowOptions.DevelopBranch) ?
                    "echo." :
                    FormatCliCommand($"checkout -b {flowDialog.FlowOptions.DevelopBranch}", false)),
                "Initializing GitFlow"
                );
            process.WaitForExit();

            EnvHelper.GetFlowOptions();
            EnvHelper.GetBranchName();
        }