Beispiel #1
0
        public SolutionFinderResult FromDir(string currentDir)
        {
            var solutionPath = FindSolutionFrom(currentDir);

            if (solutionPath.IsNotEmpty())
            {
                var appName  = Path.GetFileNameWithoutExtension(solutionPath);
                var solution = new MiruSolution(Path.GetDirectoryName(solutionPath), appName);

                return(new SolutionFinderResult(solution, currentDir));
            }

            return(SolutionFinderResult.Empty);
        }
Beispiel #2
0
        public string FindConfigYmlFromDir(string fromDir, string environment, MiruSolution solution)
        {
            var travelDir = new DirectoryInfo(fromDir);

            while (travelDir != null)
            {
                // when reaches Solution.RootDir, use ConfigDir
                if (travelDir.FullName.Equals(solution.RootDir))
                {
                    return(A.Path(solution.ConfigDir, MiruSolution.ConfigYml(environment)));
                }

                var file = A.Path(travelDir.FullName, MiruSolution.ConfigYml(environment));

                if (_fs.FileExists(file))
                {
                    return(file);
                }

                travelDir = travelDir.Parent;
            }

            return(string.Empty);
        }
Beispiel #3
0
 public Maker(MiruSolution solution)
 {
     Solution = solution;
 }
Beispiel #4
0
 public Maker(MiruSolution solution)
 {
     DryRun   = Environment.GetCommandLineArgs().Contains("--dry");
     Solution = solution;
 }