public void Setup()
        {
            _tempDir = A.TempPath("Miru", "SolutionFinderTest");

            Directories.DeleteIfExists(_tempDir);

            var maker = Maker.For(_tempDir, "Shoppers");

            maker.New("Shoppers");

            _solutionDir = _tempDir / "Shoppers";

            _solution = _solutionFinder.FromDir(_solutionDir).Solution;
        }
Example #2
0
        private void WatchRun(Func <MiruSolution, string> func)
        {
            var solutionFinder = new SolutionFinder(new FileSystem());
            var solution       = solutionFinder.FromDir(Directory.GetCurrentDirectory());

            var processRunner = new ProcessRunner(_reporter);

            // FIXME: npm and dotnet path finder:
            //  Win: where
            //  bash: which
            var webpack = new ProcessSpec()
            {
                Executable       = OS.IsWindows ? "c:\\Program Files\\nodejs\\npm.cmd" : "npm",
                WorkingDirectory = solution.Solution.AppDir,
                Arguments        = new[] { "--prefix", solution.Solution.AppDir.ToString(), "run", "watch" },
            };

            var dotnet = new ProcessSpec()
            {
                Executable       = "dotnet",
                WorkingDirectory = solution.Solution.AppDir,
                Arguments        = new[] { "watch", "run" }
            };

            var dotnetRunner  = processRunner.RunAsync(dotnet, _cts.Token);
            var webpackRunner = processRunner.RunAsync(webpack, _cts.Token);

            Task.WaitAll(dotnetRunner);
            Task.WaitAll(dotnetRunner, webpackRunner);
        }
Example #3
0
        private void ShowDir(Func <MiruSolution, string> func)
        {
            var solutionFinder = new SolutionFinder(new FileSystem());

            var result = solutionFinder.FromDir(Directory.GetCurrentDirectory());

            if (result.FoundSolution)
            {
                Console.WriteLine(func(result.Solution));
            }
            else
            {
                Console2.YellowLine($"{Directory.GetCurrentDirectory()} is not part of a Miru Solution structure");
            }
        }