private static IEnumerable <RosPackageFolder> FindInternal(string basePath, BuildType type)
        {
            var packageFolders = new List <RosPackageFolder>();

            if (RosPackageInfo.IsPackageFolder(basePath))
            {
                packageFolders.Add(new RosPackageFolder(basePath, type));
            }
            else
            {
                foreach (var directory in Directory.GetDirectories(basePath))
                {
                    packageFolders.AddRange(FindInternal(directory, type));
                }
            }

            return(packageFolders);
        }
        public RosPackageFolder(string path, BuildType type)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            path = System.IO.Path.GetFullPath(path);

            if (!Directory.Exists(path))
            {
                throw new DirectoryNotFoundException($"Directory {path} does not exit.");
            }

            if (!RosPackageInfo.IsPackageFolder(path))
            {
                throw new InvalidOperationException($"Directory {path} is not a ROS package folder (package.xml file is missing).");
            }

            Path          = path;
            BuildStrategy = type;
        }