#!/bin/sh

# overrides default from /usr/share/pkg-components/build_stages/
set -e

if [ -z ${PACKAGE} ]
then
	echo PACKAGE not set
	exit 1
fi

if [ -z ${DH_COMPONENT} ]
then
	echo DH_COMPONENT not set
	exit 1
fi

if [ -z debian/components/${DH_COMPONENT}/install ]
then
	echo debian/components/${DH_COMPONENT}/install expected with file names to install
	exit 1
fi
mod_dir="node_modules/${DH_COMPONENT}"
mkdir -p ${mod_dir}
while read line; do
  if [ ! -z ${line} ]; then cp -ar ${DH_COMPONENT}/${line} ${mod_dir}/; fi
done < debian/components/${DH_COMPONENT}/install




