/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/build/cygwin-wrapper

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs · Shell · 75 lines · 55 code · 8 blank · 12 comment · 11 complexity · 2799f4759d9e3e480293124309a84573 MD5 · raw file

  1. #!/bin/sh
  2. #
  3. # Stupid wrapper to avoid win32 dospath/cygdrive issues
  4. # Try not to spawn programs from within this file. If the stuff in here looks royally
  5. # confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
  6. # and look at the older versions of this file that are easier to read, but
  7. # do basically the same thing
  8. #
  9. prog=$1
  10. shift
  11. if test -z "$prog"; then
  12. exit 0
  13. fi
  14. # If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
  15. mountpoint=$CYGDRIVE_MOUNT
  16. if test -z "$mountpoint"; then
  17. mountpoint=`mount -p`
  18. if test -z "$mountpoint"; then
  19. print "Cannot determine cygwin mount points. Exiting"
  20. exit 1
  21. fi
  22. fi
  23. # Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
  24. mountpoint=${mountpoint#*/}
  25. mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
  26. mountpoint=${mountpoint%/}
  27. args=""
  28. up=""
  29. if test "${prog}" = "-up"; then
  30. up=1
  31. prog=${1}
  32. shift
  33. fi
  34. process=1
  35. # Convert the mountpoint in parameters to Win32 filenames
  36. # For instance: /cygdrive/c/foo -> c:/foo
  37. for i in "${@}"
  38. do
  39. if test "${i}" = "-wrap"; then
  40. process=1
  41. else
  42. if test "${i}" = "-nowrap"; then
  43. process=
  44. else
  45. if test -n "${process}"; then
  46. if test -n "${up}"; then
  47. pathname=${i#-I[a-zA-Z]:/}
  48. if ! test "${pathname}" = "${i}"; then
  49. no_i=${i#-I}
  50. driveletter=${no_i%%:*}
  51. i=-I${mountpoint}/${driveletter}/${pathname}
  52. fi
  53. else
  54. eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
  55. if ! test "${leader}" = "${i}"; then
  56. eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
  57. eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
  58. driveletter=${no_mountpoint%%/*}
  59. i=${leader}${driveletter}:/${pathname}
  60. fi
  61. fi
  62. fi
  63. args="${args} ${i}"
  64. fi
  65. fi
  66. done
  67. exec $prog $args