コード例 #1
0
        public bool Execute()
        {
            if (_resolver == null)
            {
                _logger.LogError($"No resolver found for {_source}");
                return(false);
            }

            if (!_resolver.CheckInstalled())
            {
                _logger.LogError($"{_source} isn't installed");
                return(false);
            }

            if (_resolver.CheckUpdated())
            {
                _logger.LogSuccess($"{_resolver.GetFullSource()} is up to date!");
                return(true);
            }

            _logger.LogInformation($"Updating {_source}");
            if (!_resolver.Resolve())
            {
                _logger.LogError($"Unable to update {_source}");
                return(false);
            }

            _logger.LogSuccess($"{_source} updated successfully!");
            return(true);
        }
コード例 #2
0
        public bool Execute()
        {
            if (_resolver == null)
            {
                _logger.LogError($"No resolver found for {_source}");
                return(false);
            }

            if (_resolver.CheckInstalled())
            {
                _logger.LogWarning($"{_resolver.GetFullSource()} is already installed.");
                return(true);
            }

            if (!_resolver.Exists())
            {
                _logger.LogError($"Unable to find {_resolver.GetFullSource()}");
                return(false);
            }

            _logger.LogInformation($"Installing {_resolver.GetFullSource()}");
            if (!_resolver.Resolve())
            {
                _logger.LogError($"Unable to resolve {_resolver.GetFullSource()}");
                return(false);
            }

            _logger.LogSuccess($"{_resolver.GetFullSource()} installed successfully!");
            return(true);
        }
コード例 #3
0
        public bool Execute()
        {
            if (_resolver == null)
            {
                _logger.LogError($"No resolver found for {_source}");
                return(false);
            }

            if (!_resolver.CheckInstalled())
            {
                _logger.LogError($"{_source} isn't installed");
                return(false);
            }

            _logger.LogInformation($"Uninstalling {_resolver.GetFullSource()}");
            if (!_resolver.Remove())
            {
                _logger.LogError($"{_source} couldn't be uninstalled.");
                return(false);
            }

            _logger.LogSuccess($"{_source} was uninstalled.");
            return(true);
        }