#!/bin/sh
##
##  node-openpkg.sh
##

PATH=@l_prefix@/bin:$PATH
export PATH

cmd="$1"; shift

case "$cmd" in
    squeeze )
        #   reduce files
        args="-p . -r -P -n default:safe,default:caution"
        if [ $# -gt 0 ]; then
            args="$args $@"
        fi
        eval @l_prefix@/bin/modclean $args
        ;;
    install )
        #   install files
        dst="$1"
        if [ ".$dst" = . ]; then
            echo "node-openpkg: ERROR: missing destination directory" 1>&2
            exit 1
        fi
        cp -rp node_modules/* "$RPM_BUILD_ROOT$dst"
        ;;
esac

