#!/bin/bash

version=-v16.13.2

if [ -d node-windows-64bit ] ; then
    /bin/rm -rf node-windows-64bit
fi

# Consider changing to the following, which should help with the permissions issue
# that running Cygwin's 'unzip' can sometime result in (necessitating the chmods'
#  /cygdrive/c/Windows/System32/tar.exe node${version}-win-x64.zip \

unzip node${version}-win-x64.zip \
    && mv node${version}-win-x64 node-windows-64bit

chmod a+x node-windows-64bit/*.{exe,bat,cmd} node-windows-64bit/{npm,npx}

if [ $? = 0 ] ; then
    echo "Unzipped node$version-win-x64.zip and renamed the directory to:"
    echo "  node-windows-64bit"
fi


