Exemplo n.º 1
0
        /// <summary>
        /// Actions under the resolver.
        /// </summary>
        protected override void ExecuteTaskResolved()
        {
            // Get the stage
            var stage = (RegistrationStage)TypeDescriptor.GetConverter(typeof(RegistrationStage)).ConvertFromString(Bag.GetString(AttributeName.Stage));

            // Collect the installation data and install it
            LocalInstaller.Install(CreateInstaller().HarvestInstallationData(), stage, GetMacros(), root => new DirectoryInfo(ResolveSourceDirRoot(root, Bag)), root => new DirectoryInfo(ResolveTargetDirRoot(root, Bag)), text => { Log.LogMessage(MessageImportance.Low, text); });
        }
Exemplo n.º 2
0
        public void Test_Install()
        {
            var installer = new LocalInstaller(
                OriginalDirectory,
                WorkingDirectory,
                "csAnt",
                true
                );

            installer.Install();
        }
Exemplo n.º 3
0
        public void Test_Install_Import()
        {
            var installer = new LocalInstaller(
                OriginalDirectory,
                WorkingDirectory,
                "csAnt",
                true
                );

            installer.ImportPath = OriginalDirectory;
            installer.Import     = true;

            installer.Install();
        }
Exemplo n.º 4
0
        public void Test_Install_Clone()
        {
            var installer = new LocalInstaller(
                OriginalDirectory,
                WorkingDirectory,
                "csAnt",
                true
                );

            installer.CloneSource = OriginalDirectory;
            installer.Clone       = true;

            installer.Install();

            Assert.IsTrue(
                Directory.Exists(PathConverter.ToAbsolute(".git")),
                "The .git folder wasn't found."
                );
        }
Exemplo n.º 5
0
    public override bool Run(string[] args)
    {
        var packageName = "csAnt";
        var destination = "";

        if (args.Length >= 2)
        {
            packageName = args[0];
            destination = args[1];
        }
        else if (args.Length >= 1)
        {
            destination = Path.GetFullPath(args[1]);
        }

        if (destination == "")
        {
            throw new Exception("A destination must be specified as an argument.");
        }

        var installer = new LocalInstaller(
            CurrentDirectory,
            destination,
            packageName,
            true
            );

        installer.Install();

        var arguments = new Arguments(args);

        if (arguments.Contains("r"))
        {
            Relocate(destination);
        }

        return(!IsError);
    }