cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject git commit: CB-6042 [windows8] Cordova emulate fails if no developer certificate is installed
Date Sat, 22 Feb 2014 05:18:21 GMT
Repository: cordova-windows
Updated Branches:
  refs/heads/master feac47f6d -> 9768a159a


CB-6042 [windows8] Cordova emulate fails if no developer certificate is installed


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/9768a159
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/9768a159
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/9768a159

Branch: refs/heads/master
Commit: 9768a159a3d89f63efe54b648b7667990b46fe58
Parents: feac47f
Author: sgrebnov <sergei.grebnov@gmail.com>
Authored: Fri Feb 14 23:59:33 2014 +0400
Committer: sgrebnov <sergei.grebnov@gmail.com>
Committed: Fri Feb 14 23:59:33 2014 +0400

----------------------------------------------------------------------
 .../template/cordova/lib/WindowsStoreAppUtils   | 26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/9768a159/windows8/template/cordova/lib/WindowsStoreAppUtils
----------------------------------------------------------------------
diff --git a/windows8/template/cordova/lib/WindowsStoreAppUtils b/windows8/template/cordova/lib/WindowsStoreAppUtils
index ded93cf..4ea51a9 100644
--- a/windows8/template/cordova/lib/WindowsStoreAppUtils
+++ b/windows8/template/cordova/lib/WindowsStoreAppUtils
@@ -66,12 +66,36 @@ function Uninstall-App {
     }
 }
 
+#
+# Checks whether the machine is missing a valid developer license.
+#
+function CheckIfNeedDeveloperLicense
+{
+    $Result = $true
+    try
+    {
+        $Result = (Get-WindowsDeveloperLicense | Where-Object { $_.IsValid }).Count -eq 0
+    }
+    catch {}
+
+    return $Result
+}
+
 function Install-App {
     param(
         [Parameter(Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)]
         [string] $Path <# Full path to Add-AppDevPackage.ps1 #>
     )
-    Invoke-Expression ($Path + " -force")
+
+    if (CheckIfNeedDeveloperLicense)
+    {
+        # we can't run the script with -force param if license installation step is required
+        Invoke-Expression ($Path)
+    }
+    else
+    {
+        Invoke-Expression ($Path + " -force")
+    }
 }
 
 function Start-Locally {


Mime
View raw message