"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/scripts/relocate.sh" (8 Mar 2017, 665 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 # Change the cli shebang to point at the specified node
    4 # Useful for when the program is moved around after install.
    5 # Also used by the default 'make install' in node to point
    6 # npm at the newly installed node, rather than the first one
    7 # in the PATH, which would be the default otherwise.
    8 
    9 # bash /path/to/npm/scripts/relocate.sh $nodepath
   10 # If $nodepath is blank, then it'll use /usr/bin/env
   11 
   12 dir="$(dirname "$(dirname "$0")")"
   13 cli="$dir"/bin/npm-cli.js
   14 tmp="$cli".tmp
   15 
   16 node="$1"
   17 if [ "x$node" = "x" ]; then
   18   node="/usr/bin/env node"
   19 fi
   20 node="#!$node"
   21 
   22 sed -e 1d "$cli" > "$tmp"
   23 echo "$node" > "$cli"
   24 cat "$tmp" >> "$cli"
   25 rm "$tmp"
   26 chmod ogu+x $cli