コード例 #1
0
 public static void Publish(NpmCommandCallback action, string registry)
 {
     if (string.IsNullOrEmpty(registry))
     {
         NpmUtils.ExecuteNpmCommand($"publish ", action);
     }
     else
     {
         NpmUtils.ExecuteNpmCommand($"publish --registry {registry}", action);
     }
 }
コード例 #2
0
 public static void WhoAmI(string registry, Action <string> callback)
 {
     NpmUtils.ExecuteNpmCommand($"whoami --registry {registry}", (code, result) =>
     {
         if (code == 0)
         {
             callback(result.Trim());
         }
         else
         {
             callback(null);
         }
     });
 }