Пример #1
0
        private static IEnvironment GetEnvironment()
        {
            var environment = new CurrentDirectoryEnvironment();

            environment.Initialize();
            return(environment);
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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);
            }
        }