CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
nanoid.ps129 linesDownload Raw Back to .bin
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/../nanoid/bin/nanoid.cjs" $args15  } else {16    & "$basedir/node$exe"  "$basedir/../nanoid/bin/nanoid.cjs" $args17  }18  $ret=$LASTEXITCODE19} else {20  # Support pipeline input21  if ($MyInvocation.ExpectingInput) {22    $input | & "node$exe"  "$basedir/../nanoid/bin/nanoid.cjs" $args23  } else {24    & "node$exe"  "$basedir/../nanoid/bin/nanoid.cjs" $args25  }26  $ret=$LASTEXITCODE27}28exit $ret29