public static void Publish(
            string root,
            PublishOptions publishOptions,
            ProjectPackSubSystem.PackOptions packOptions)
        {
            string src = Path.Combine(root, "build", "module.json");

            ProjectPackSubSystem.Pack(root, packOptions);

            if (!File.Exists(src))
            {
                EventManager <ErrorEvent> .SendEvent(new FileNotFoundEvent( src, false ));

                return;
            }

            ProjectConfig t = ProjectConfig.Load(src);

            Logger.LogMessage(LoggerSystems.ModuleSystem, "Publishing '{0}'", src);

            ProjectResolver.GetManager(publishOptions.Repository).
            AddPackage(
                t,
                Path.Combine(root, "build", "module.zip")
                );
        }
        public override void Run(IEnumerable <string> args)
        {
            string[] a = args.ToArray();

            string root = a.Length != 0
                              ? Path.GetFullPath(a[1])
                              : Directory.GetCurrentDirectory();

            ProjectPackSubSystem.PackOptions op = new ProjectPackSubSystem.PackOptions();
            PublishOptions pops = new PublishOptions();

            ArgumentSyntaxParser.Parse(args.ToArray(), op, pops);
            Publish(root, pops, op);
        }