mirror of
https://github.com/actions/node-versions.git
synced 2025-12-22 10:15:28 +08:00
Implement script to prepare packages with Node.js
This commit is contained in:
25
installers/nix-setup-template.sh
Normal file
25
installers/nix-setup-template.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
set -e
|
||||
|
||||
NODE_VERSION={0}
|
||||
|
||||
NODE_TOOLCACHE_PATH=$AGENT_TOOLSDIRECTORY/node
|
||||
NODE_TOOLCACHE_VERSION_PATH=$NODE_TOOLCACHE_PATH/$NODE_VERSION
|
||||
NODE_TOOLCACHE_VERSION_ARCH_PATH=$NODE_TOOLCACHE_VERSION_PATH/x64
|
||||
|
||||
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"
|
||||
touch $NODE_TOOLCACHE_VERSION_PATH/x64.complete
|
||||
Reference in New Issue
Block a user