版博士V2.0程序
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

42 rader
1.4 KiB

  1. #!/usr/bin/env pwsh
  2. $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
  3. $exe=""
  4. $pathsep=":"
  5. $env_node_path=$env:NODE_PATH
  6. $new_node_path="$basedir\E:\HalftoneWeb\node_modules\.store\typescript@5.2.2\node_modules"
  7. if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
  8. # Fix case when both the Windows and Linux builds of Node
  9. # are installed in the same directory
  10. $exe=".exe"
  11. $pathsep=";"
  12. } else {
  13. $new_node_path="$basedir/E:/HalftoneWeb/node_modules/.store/typescript@5.2.2/node_modules"
  14. }
  15. if ([string]::IsNullOrEmpty($env_node_path)) {
  16. $env:NODE_PATH=$new_node_path
  17. } else {
  18. $env:NODE_PATH="$env_node_path$pathsep$new_node_path"
  19. }
  20. $ret=0
  21. if (Test-Path "$basedir/node$exe") {
  22. # Support pipeline input
  23. if ($MyInvocation.ExpectingInput) {
  24. $input | & "$basedir/node$exe" "$basedir/../.store/typescript@5.2.2/node_modules/typescript/bin/tsserver" $args
  25. } else {
  26. & "$basedir/node$exe" "$basedir/../.store/typescript@5.2.2/node_modules/typescript/bin/tsserver" $args
  27. }
  28. $ret=$LASTEXITCODE
  29. } else {
  30. # Support pipeline input
  31. if ($MyInvocation.ExpectingInput) {
  32. $input | & "node$exe" "$basedir/../.store/typescript@5.2.2/node_modules/typescript/bin/tsserver" $args
  33. } else {
  34. & "node$exe" "$basedir/../.store/typescript@5.2.2/node_modules/typescript/bin/tsserver" $args
  35. }
  36. $ret=$LASTEXITCODE
  37. }
  38. $env:NODE_PATH=$env_node_path
  39. exit $ret