jnthn / p6-ssh-libssh

Asynchronous binding for libssh; client-only and limited functionality so far.
8 stars 8 forks source link

powershell function for SHA256 generates error #14

Open washuu opened 5 years ago

washuu commented 5 years ago
===> Searching for: SSH::LibSSH
===> Searching for missing dependencies: Concurrent::Progress
===> Searching for missing dependencies: Test::Scheduler
===> Building: SSH::LibSSH
At line:1 char:192
+ ... )) -replace \"-\",\"\" } get-sha256 C:\Users\rstanilewicz\.zef\store\p6-ssh-libs ...
+                    ~
You must provide a value expression on the right-hand side of the '-' operator.
At line:1 char:192
+ "function get-sha256 { param($file);[system.bitconverter]::tostring([System.Secu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '\",\"\" } get-sha256 C:\Users\rstanilewicz\.zef\store\p6-ssh-libssh.git\926d72092eb9c9757f15f3095ecda
45553193bc9\resources\ssh.dll"' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

Effective index out of range. Is: -1, should be in 0..^Inf
  in method build at C:\Users\rstanilewicz\.zef\store\p6-ssh-libssh.git\926d72092eb9c9757f15f3095ecda45553193bc9\Build.p
m line 22
  in block <unit> at -e line 1 

it is because over-escaped slashes in $HOME.zef\store\p6-ssh-libssh.git\926d72092eb9c9757f15f3095ecda45553193bc9\Build.pm. Please replace

 -replace \"-\",\"\" 

with

-replace "-",""
washuu commented 5 years ago

or please ditch the "replace" option altogether, and put the hashes with "-" characters - the most compatible option...

BTW: my PowerShell version is 3.0.

jnthn commented 5 years ago

The line that needs changing is probably here. I'm not in a position to do/test this change at the moment, but if you are able to do so and submit a PR, I can merge it. (Otherwise, will have to wait a week or so after vacation.) Thanks!