예제 #1
0
        static void Execute()
        {
            Dictionary <string, string> args = CommandLineArguments.Build(
                Environment.GetCommandLineArgs());

            mLog.DebugFormat(
                "Processing Unity arguments: {0}",
                string.Join(" ", Environment.GetCommandLineArgs()));

            string projectPath       = ParseArguments.ProjectPath(args);
            string cloudRepository   = ParseArguments.CloudProject(args);
            string cloudOrganization = ParseArguments.CloudOrganization(args);

            if (string.IsNullOrEmpty(projectPath) ||
                string.IsNullOrEmpty(cloudRepository) ||
                string.IsNullOrEmpty(cloudOrganization))
            {
                return;
            }

            PlasticApp.Initialize();

            DownloadRepositoryOperation downloadOperation = new DownloadRepositoryOperation();

            downloadOperation.DownloadRepositoryToPathIfNeeded(
                cloudRepository,
                cloudOrganization,
                Path.GetFullPath(projectPath));
        }
예제 #2
0
        internal static void DownloadRepository(string unityAccessToken, string[] commandLineArgs)
        {
            Dictionary <string, string> args = CommandLineArguments.Build(commandLineArgs);

            mLog.DebugFormat(
                "Processing Unity arguments: {0}", string.Join(" ", commandLineArgs));

            string projectPath       = ParseArguments.ProjectPath(args);
            string cloudRepository   = ParseArguments.CloudProject(args);
            string cloudOrganization = ParseArguments.CloudOrganization(args);

            if (string.IsNullOrEmpty(projectPath) ||
                string.IsNullOrEmpty(cloudRepository) ||
                string.IsNullOrEmpty(cloudOrganization))
            {
                return;
            }

            SessionState.SetBool(
                SHOULD_PROJECT_BE_DOWNLOADED_KEY, true);

            PlasticApp.InitializeIfNeeded();

            DownloadRepositoryOperation downloadOperation =
                new DownloadRepositoryOperation();

            downloadOperation.DownloadRepositoryToPathIfNeeded(
                cloudRepository,
                cloudOrganization,
                Path.GetFullPath(projectPath),
                unityAccessToken);
        }