private void DoPublish()
        {
            var header = $"Npm: {Registry}";
            var msg    = $"Are you really want to publish package {package.name}: {package.version}?";

            if (!EditorUtility.DisplayDialog(header, msg, "Publish", "Cancel"))
            {
                return;
            }

            NpmPublishCommand.Execute(packageAsset, () =>
            {
                //
                UpmClientUtils.ListPackages(() => Refresh(false));
            });
        }
Exemple #2
0
        public static IEnumerator PublishPackages(IDictionary <TextAsset, Package> toPublish)
        {
            var nl      = Environment.NewLine;
            var message = $"Following packages would be published:" +
                          toPublish.Aggregate("", (s, c) => s + $"{nl} - {c.Value.name}: {c.Value.version}");

            var header = $"Npm {NpmPublishPreferences.Registry}";

            if (!EditorUtility.DisplayDialog(header, message, "Publish", "Cancel"))
            {
                yield break;
            }

            try
            {
                foreach (var asset in toPublish)
                {
                    EditorUtility.DisplayProgressBar("Npm Publish", asset.Key.name, 1f);

                    while (NpmUtils.IsNpmRunning)
                    {
                        yield return(null);
                    }

                    bool done = false;
                    NpmPublishCommand.Execute(asset.Key, () => done = true);

                    while (!done)
                    {
                        yield return(null);
                    }

                    Debug.Log("OK " + asset.Key);
                }
            }
            finally
            {
                EditorUtility.ClearProgressBar();
            }
        }