Open panesofglass opened 7 years ago
Soo.... anyone is using .ps1
files for FAKE ? I guess it was never tested. ;)
I don't even know if node can spawn .ps1
files
Quick googling suggests that .ps1
files will need some additional handling - http://stackoverflow.com/questions/10179114/execute-powershell-script-from-node-js
@Krzysztof-Cieslak can you point to where I need to hook this up? I am happy to work on it.
Quick and dirty solution might be to parse the extension and, if it's ps1
change https://github.com/panesofglass/ionide-vscode-fake/blob/master/src/fake.fs#L36 to use
let cmd =
match System.IO.File.GetExtension(target) with
| "ps1" -> sprintf "powershell.exe %s" (fixSpaces target)
| _ -> fixSpaces target
let proc = Process.spawnWithNotification command linuxPrefix cmd outputChannel
Also, assuming target
is the location
, I'm confused why https://github.com/ionide/ionide-atom-helpers/blob/master/src/ProcessHelpers.fs#L118 seems to have the target
and command
parameters flipped. Am I reading that wrong? Should the above actually be:
let cmd =
if System.IO.File.GetExtension(command) = "ps1"
then "powershell.exe " + command
else command
let proc = Process.spawnWithNotification cmd linuxPrefix (fixSpaces target) outputChannel
As an alternative, the normal way one invokes powershell from a cmd.exe
is with @powershell ...
That might be better than hoping powershell.exe
is on the path.
Whenever I try to run FAKE Build with a local
.ionide
file usingbuild.ps1
, I see the following banner:I also see this in the Developer Tools Console window:
Environment:
Please let me know how I can help if this is an actual bug.