2020-04-23 09:58:18 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
NODE_VERSION={0}
|
2023-11-08 08:43:29 +00:00
|
|
|
ARCH={1}
|
2020-04-23 09:58:18 +00:00
|
|
|
|
|
|
|
NODE_TOOLCACHE_PATH=$AGENT_TOOLSDIRECTORY/node
|
|
|
|
NODE_TOOLCACHE_VERSION_PATH=$NODE_TOOLCACHE_PATH/$NODE_VERSION
|
2023-11-08 08:43:29 +00:00
|
|
|
NODE_TOOLCACHE_VERSION_ARCH_PATH=$NODE_TOOLCACHE_VERSION_PATH/$ARCH
|
2020-04-23 09:58:18 +00:00
|
|
|
|
|
|
|
echo "Check if Node.js hostedtoolcache folder exist..."
|
|
|
|
if [ ! -d $NODE_TOOLCACHE_PATH ]; then
|
|
|
|
mkdir -p $NODE_TOOLCACHE_PATH
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Delete Node.js $NODE_VERSION if installed"
|
|
|
|
rm -rf $NODE_TOOLCACHE_VERSION_PATH
|
|
|
|
|
|
|
|
echo "Create Node.js $NODE_VERSION folder"
|
|
|
|
mkdir -p $NODE_TOOLCACHE_VERSION_ARCH_PATH
|
|
|
|
|
|
|
|
echo "Copy Node.js binaries to hostedtoolcache folder"
|
|
|
|
cp -R ./* $NODE_TOOLCACHE_VERSION_ARCH_PATH
|
|
|
|
rm $NODE_TOOLCACHE_VERSION_ARCH_PATH/setup.sh
|
|
|
|
|
|
|
|
echo "Create complete file"
|
2023-11-08 08:43:29 +00:00
|
|
|
touch $NODE_TOOLCACHE_VERSION_PATH/$ARCH.complete
|