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