internal ConsoleApp(string[] args, Assembly assembly, IContainer container)
        {
            _args      = args;
            _container = container;
            // TypeAttributePair is just a typed tuple of an IAction type and one of its action attribute.
            _actionAttributes = assembly
                                .GetTypes()
                                .Where(t => typeof(IAction).IsAssignableFrom(t) && !t.IsAbstract)
                                .Select(type => type.GetCustomAttributes <ActionAttribute>().Select(a => new TypeAttributePair {
                Type = type, Attribute = a
            }))
                                .SelectMany(i => i);

            GlobalCoreToolsSettings.Init(container.Resolve <ISecretsManager>(), args);
        }
Example #2
0
        internal ConsoleApp(string[] args, Assembly assembly, IContainer container)
        {
            _args           = args;
            _container      = container;
            _telemetryEvent = new TelemetryEvent();
            // TypeAttributePair is just a typed tuple of an IAction type and one of its action attribute.
            _actionAttributes = assembly
                                .GetTypes()
                                .Where(t => typeof(IAction).IsAssignableFrom(t) && !t.IsAbstract)
                                .Select(type => type.GetCustomAttributes <ActionAttribute>().Select(a => new TypeAttributePair {
                Type = type, Attribute = a
            }))
                                .SelectMany(i => i);

            // Check if there is a --prefix or --script-root and update CurrentDirectory
            UpdateCurrentDirectory(args);
            GlobalCoreToolsSettings.Init(container.Resolve <ISecretsManager>(), args);
        }