コード例 #1
0
        private void SaveText()
        {
            if (_DbObjectText == null)
            {
                _DbObjectText = _IDEProvider.GetDbObject <IDbObjectText>();
            }
            else
            {
                _DbObjectText.DirectoriesChecks();
            }

            if (_BranchName == null)
            {
                _BranchName = _GitAPI.GetCurrentBranch();
            }

            if (_Warnings.IsBranchUnexsepted(_BranchName))
            {
                return;
            }

            string FilePath = _DbObjectText.GetRawFilePath();

            Seri.Log.Here().Debug("FilePath={0}", FilePath);

            File.WriteAllText(FilePath, _DbObjectText.Text, _DbObjectText.GetSaveEncoding());
            _IDEProvider.SetStatusMessage($"Объект БД сохранён в: {FilePath}");
        }
コード例 #2
0
        protected override void BeforeProcess()
        {
            tmpPath = $"{_dbObj.GetRawFilePath()}.tmp";

            Seri.Log.Here().Debug($"Создаём временный файл. path: {tmpPath}");
            File.WriteAllText(tmpPath, _dbObj.Text, _dbObj.GetSaveEncoding());
            Seri.Log.Here().Debug("Временный файл создан");

            AddArgument("diff");
            AddArgumentCrAtEol();
            AddArgumentSpaceAtEol();
            AddArgument("--no-index");
            AddArgument($"\"{_dbObj.GetRawFilePath()}\"");
            AddArgument($"\"{tmpPath}\"");

            base.BeforeProcess();
        }