Example #1
0
        // private helper to deploy destination location by name
        // @handled
        private static void Deploy(string fromPath, string deploymentName, string destPath)
        {
            if (!PyRevitClone.VerifyHasDeployments(fromPath))
            {
                throw new PyRevitException("There are no deployments configured.");
            }

            foreach (var dep in PyRevitClone.GetConfiguredDeployments(fromPath))
            {
                // compare lowercase deployment names
                if (dep.Name.ToLower() == deploymentName.ToLower())
                {
                    logger.Debug("Found deployment \"{0}\"", deploymentName);
                    Deploy(fromPath, dep, destPath);
                    return;
                }
            }

            // means no deployment were found with given name
            throw new PyRevitException(string.Format("Can not find deployment \"{0}\" in \"{1}\"",
                                                     deploymentName, fromPath));
        }