Exemple #1
0
        private async Task PreRunConditions(WorkerRuntime workerRuntime)
        {
            if (workerRuntime == WorkerRuntime.python)
            {
                PythonHelpers.VerifyVirtualEnvironment();
            }
            else if (workerRuntime == WorkerRuntime.dotnet && !NoBuild)
            {
                if (DotnetHelpers.CanDotnetBuild())
                {
                    var outputPath = Path.Combine("bin", "output");
                    await DotnetHelpers.BuildDotnetProject(outputPath, string.Empty);

                    Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, outputPath);
                }
                else if (StaticSettings.IsDebug)
                {
                    ColoredConsole.WriteLine("Could not find a valid .csproj file. Skipping the build.");
                }
            }

            if (!NetworkHelpers.IsPortAvailable(Port))
            {
                throw new CliException($"Port {Port} is unavailable. Close the process using that port, or specify another port using --port [-p].");
            }
        }
 private void PreRunConditions()
 {
     if (_secretsManager.GetSecrets().Any(p => p.Key == Constants.FunctionsWorkerRuntime && p.Value == "Python"))
     {
         PythonHelpers.VerifyVirtualEnvironment();
     }
 }
        private async Task PreRunConditions(WorkerRuntime workerRuntime)
        {
            if (workerRuntime == WorkerRuntime.python)
            {
                PythonHelpers.VerifyVirtualEnvironment();
            }
            else if (workerRuntime == WorkerRuntime.dotnet && Build)
            {
                const string outputPath = "bin/output";
                await DotnetHelpers.BuildDotnetProject(outputPath);

                Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, outputPath);
            }
        }
Exemple #4
0
        private async Task PreRunConditions(WorkerRuntime workerRuntime)
        {
            if (workerRuntime == WorkerRuntime.python)
            {
                PythonHelpers.VerifyVirtualEnvironment();
            }
            else if (workerRuntime == WorkerRuntime.dotnet && Build)
            {
                const string outputPath = "bin/output";
                await DotnetHelpers.BuildDotnetProject(outputPath, string.Empty);

                Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, outputPath);
            }

            if (!NetworkHelpers.IsPortAvailable(Port))
            {
                throw new CliException($"Port {Port} is unavailable. Close the process using that port, or specify another port using --port [-p].");
            }
        }