private void ScriptRunnerComplete(object sender, EventArgs <string> e)
        {
            var scriptFileToDelete = e.Value;

            if (SelectedProfile.RemotingEnabled || scriptFileToDelete.StartsWith(Folders.Cache))
            {
                // this cannot be used at constructor as SelectedProfile will be null when no profiles yet are created
                _filesystem = Create.Filesystem.WithCurrentProfile(_view);
                _filesystem.DeleteFile(scriptFileToDelete);
            }
        }
Пример #2
0
        private void DeleteFile(string filePath)
        {
            filePath = NormalizeAndEvaluate(filePath);

            if (_filesystem.FileExists(filePath))
            {
                Log.DebugFormat("Deleting file '{0}'...", filePath);
                _filesystem.DeleteFile(filePath);
                Log.InfoFormat("Deleted file '{0}'", filePath);
            }
        }
Пример #3
0
        public override void DeleteFiles(string wildcardPattern)
        {
            var operation = _operationTracker.BeginDeleteFile(wildcardPattern);

            try
            {
                foreach (var file in EnumerateFilesPrivate(wildcardPattern))
                {
                    _filesystem.DeleteFile(file);
                }
                operation.Success();
            }
            catch (Exception e)
            {
                operation.Failed(e);
                throw;
            }
        }
 public void Unexecute()
 {
     filesystem.DeleteFile(destination);
 }