opusdev/vector-similarity-api
1
1#!/usr/bin/env pwsh2$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent3 4$exe=""5if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {6 # Fix case when both the Windows and Linux builds of Node7 # are installed in the same directory8 $exe=".exe"9}10$ret=011if (Test-Path "$basedir/node$exe") {12 # Support pipeline input13 if ($MyInvocation.ExpectingInput) {14 $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args15 } else {16 & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args17 }18 $ret=$LASTEXITCODE19} else {20 # Support pipeline input21 if ($MyInvocation.ExpectingInput) {22 $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args23 } else {24 & "node$exe" "$basedir/../semver/bin/semver.js" $args25 }26 $ret=$LASTEXITCODE27}28exit $ret29 