예제 #1
0
        private static ExecutionEnvironment LoadEnvironment(string[] args)
        {
            ExecutionEnvironment result = new ExecutionEnvironment();

            if (args.Length == 0)
            {
                DirectoryInfo parentDir = new DirectoryInfo(@"C:\Downloads");
                var srcDirectories = parentDir.GetDirectories("SRC_D3 Main*");
                if (srcDirectories.Length == 1)
                {
                    result.WorkingDirectory = srcDirectories[0].FullName;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Unable to find source code directory.");
                    Console.ReadLine();
                    Environment.Exit(0);
                }
            }
            else
            {
                result.WorkingDirectory = args[0].TrimStart('\"').TrimEnd('\"');
            }
            return result;
        }
예제 #2
0
		public override void Apply(ExecutionEnvironment env)
		{
			var pathToDelete = Path.Combine(env.WorkingDirectory, FolderPath);

			if (Directory.Exists(pathToDelete))
			{
				Directory.Delete(pathToDelete, true);
				Console.WriteLine("Deleted folder \"{0}\"", FolderPath);
			}
		}
예제 #3
0
		public override void Apply(ExecutionEnvironment env)
		{
			string filePath = Path.Combine(env.WorkingDirectory, FilePath);

			if (File.Exists(filePath))
			{
				File.Delete(filePath);

				Console.WriteLine("Deleted file \"{0}\"", FilePath);
			}
		}
예제 #4
0
		public override void Apply(ExecutionEnvironment env)
		{
			var sln = File.ReadAllLines(Path.Combine(env.WorkingDirectory, @"sln\DynamicDataDisplay\DynamicDataDisplay.sln")).ToList();

			string guid = "";
			for (int i = 0; i < sln.Count; i++)
			{
				var line = sln[i];
				if (line.StartsWith("Project"))
				{
					var subLine = line.Substring(53);
					var lineParts = subLine.Split('"');

					var name = lineParts[0];
					guid = lineParts[4];

					if (name == ProjectName)
					{
						sln.RemoveAt(i);
						sln.RemoveAt(i);
						break;
					}
				}
			}

			if (guid == "")
			{
				Console.ForegroundColor = ConsoleColor.Red;
				Console.WriteLine("Project \"{0}\" not found.", ProjectName);
				Console.ForegroundColor = ConsoleColor.White;
				return;
			}

			int j = 0;
			while (j < sln.Count)
			{
				var line = sln[j];
				if (line.Contains(guid))
				{
					sln.RemoveAt(j);
				}
				else
				{
					j++;
				}
			}

			File.WriteAllLines(Path.Combine(env.WorkingDirectory, @"sln\DynamicDataDisplay\DynamicDataDisplay.sln"), sln.ToArray());

			Console.WriteLine("Removed project \"{0}\"", ProjectName);
		}
		public override void Apply(ExecutionEnvironment env)
		{
			DirectoryInfo dir = new DirectoryInfo(env.WorkingDirectory);

			DeleteFolderRecursively(dir);
		}
예제 #6
0
		public override void Apply(ExecutionEnvironment env)
		{
			Console.WriteLine();
		}
예제 #7
0
		public abstract void Apply(ExecutionEnvironment env);