xref: /third_party/node/deps/corepack/shims/pnpm.ps1
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/corepack/shims/
11cb0ef41Sopenharmony_ci#!/usr/bin/env pwsh
21cb0ef41Sopenharmony_ci$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci$exe=""
51cb0ef41Sopenharmony_ciif ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
61cb0ef41Sopenharmony_ci  # Fix case when both the Windows and Linux builds of Node
71cb0ef41Sopenharmony_ci  # are installed in the same directory
81cb0ef41Sopenharmony_ci  $exe=".exe"
91cb0ef41Sopenharmony_ci}
101cb0ef41Sopenharmony_ci$ret=0
111cb0ef41Sopenharmony_ciif (Test-Path "$basedir/node$exe") {
121cb0ef41Sopenharmony_ci  # Support pipeline input
131cb0ef41Sopenharmony_ci  if ($MyInvocation.ExpectingInput) {
141cb0ef41Sopenharmony_ci    $input | & "$basedir/node$exe"  "$basedir/../dist/pnpm.js" $args
151cb0ef41Sopenharmony_ci  } else {
161cb0ef41Sopenharmony_ci    & "$basedir/node$exe"  "$basedir/../dist/pnpm.js" $args
171cb0ef41Sopenharmony_ci  }
181cb0ef41Sopenharmony_ci  $ret=$LASTEXITCODE
191cb0ef41Sopenharmony_ci} else {
201cb0ef41Sopenharmony_ci  # Support pipeline input
211cb0ef41Sopenharmony_ci  if ($MyInvocation.ExpectingInput) {
221cb0ef41Sopenharmony_ci    $input | & "node$exe"  "$basedir/../dist/pnpm.js" $args
231cb0ef41Sopenharmony_ci  } else {
241cb0ef41Sopenharmony_ci    & "node$exe"  "$basedir/../dist/pnpm.js" $args
251cb0ef41Sopenharmony_ci  }
261cb0ef41Sopenharmony_ci  $ret=$LASTEXITCODE
271cb0ef41Sopenharmony_ci}
281cb0ef41Sopenharmony_ciexit $ret
29

Indexes created Thu Nov 07 10:32:03 CST 2024