private static IEnvironment GetEnvironment() { var environment = new CurrentDirectoryEnvironment(); environment.Initialize(); return(environment); }
IEnumerable <ICommandOutput> SetEnvironmentToFromInput() { if (From != null) { var directory = _fileSystem.GetDirectory(From); if (directory.Exists == false) { yield return(new DirectoryNotFound(directory)); yield break; } var newEnv = new CurrentDirectoryEnvironment(directory); newEnv.Initialize(); _environment = newEnv; } }
IEnumerable <ICommandOutput> FromEnvironmentNotFound() { if (From != null) { var directory = _fileSystem.GetDirectory(From); if (directory.Exists == false) { yield return(new Error("Directory '{0}' not found.", From)); yield break; } var newEnv = new CurrentDirectoryEnvironment(directory); newEnv.Initialize(); if (newEnv.ScopedDescriptors.Any() == false) { yield return(new Error("No descriptor found in directory '{0}'.", From)); yield break; } _environment = newEnv; //return new Info("Building package at '{0}'.", From); } }