Skip to content

Instantly share code, notes, and snippets.

@kevinastone
Last active April 3, 2023 08:17
Show Gist options
  • Save kevinastone/8790717 to your computer and use it in GitHub Desktop.
Save kevinastone/8790717 to your computer and use it in GitHub Desktop.

Revisions

  1. kevinastone revised this gist Feb 3, 2014. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions tmp_npm.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,7 @@
    #!/bin/bash

    BASE_DIR=/var/tmp

    BASE_DIR=${TMPDIR:-/var/tmp}
    ORIG_DIR=$PWD

    HASH_CMD="md5sum"

    DIR_NAME=`echo $PWD | $HASH_CMD | cut -f1 -d " "`
  2. kevinastone created this gist Feb 3, 2014.
    22 changes: 22 additions & 0 deletions tmp_npm.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/bash

    BASE_DIR=/var/tmp

    ORIG_DIR=$PWD

    HASH_CMD="md5sum"

    DIR_NAME=`echo $PWD | $HASH_CMD | cut -f1 -d " "`

    TMP_DIR=$BASE_DIR/$DIR_NAME
    mkdir -p $TMP_DIR

    pushd $TMP_DIR

    ln -sf $ORIG_DIR/package.json
    npm $1

    # Can't use archive mode cause of the permissions
    rsync --recursive --links --times node_modules $ORIG_DIR

    popd