[Craft] [Bug 429299] launch Craft by running craftenv.ps1 falls on BadExpression error

Gary Wang bugzilla_noreply at kde.org
Thu Nov 19 10:10:39 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=429299

--- Comment #8 from Gary Wang <wzc782970009 at gmail.com> ---
(In reply to Hannah von Reth from comment #7)
> Hm not at that pint, you could add some print statements to
> https://invent.kde.org/packaging/craft/-/blob/master/craftenv.ps1#L24 
> 
> Like: write-host $py.Source $py.Version

Oh I got it! findPython("python3") and findPython("python") will always got
version 0.0.0.0. Append a line findPython("py") after findPython("python")
works and it can run under both PowerShell 5.1 and PowerShell 7.1 now! Here is
the patch:



diff --git a/craftenv.ps1 b/craftenv.ps1
index 11ffe5221..b2bfb513a 100644
--- a/craftenv.ps1
+++ b/craftenv.ps1
@@ -79,6 +79,7 @@ findPython("python3.7")
 findPython("python3.6")
 findPython("python3")
 findPython("python")
+findPython("py")
 }

 function Global:craft()



Thanks a lot for helping me out!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Kde-windows mailing list