Commit f3545b00 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] patches for windows support

parent 0a8f02f3
......@@ -26,13 +26,29 @@ elif [ -e "./sgc-scripts/$1.sh" ]; then
./sgc-scripts/$1.sh
else
cd sgc-core
. ~/.nvm/nvm.sh
# the nvm config file will only exist on unix systems
if [ ! $OSTYPE == "msys" ]
then
. ~/.nvm/nvm.sh
fi
# include version config
. ./core/node.sh
# set node version
nvm use ${nodeversion}
if [ ! $OSTYPE == "msys" ]
then
# set node version
nvm use ${nodeversion}
else
# interestingly, setting the node version here will break on windows. for some reason the node and npm commands
# wont't be available anymore afterwards. tell the user instead.
if [ ! $(node -v) == "v${nodeversion}" ]
then
echo -e "\033[0;31mWrong node version! Please run 'nvm use ${nodeversion}\033[0m";
exit 1;
fi
fi
node ./node_modules/gulp/bin/gulp.js $@
fi
......@@ -33,6 +33,8 @@ gulp.task('watch', function() {
});
function setCurrentExtensionName(file) {
// the filepath will contain backslashes instead of slashes on windows. we need to normalize this.
file = file.replace(/\\/g, '/');
plugins.util.log(plugins.util.colors.blue('Change detected in ') + plugins.util.colors.green(file));
settings.setPath(file.split(config.directories.basePath)[1].split('/')[0]);
}
......
......@@ -23,6 +23,7 @@ cd ./sgc-core
if [ $OSTYPE == "msys" ]
then
# nvm installation on windows cannot be automated
if [ -z `which nvm` > /dev/null ]
then
echo -e "\n\033[0;31mYou need to install the Node Version Manager for Windows before you can proceed with the installation.\033[0m"
......@@ -34,18 +35,23 @@ else
echo -e "\033[0;32mSetup Node Version Manager...\033[0m\n"
./core/installers/nvm.sh > /dev/null
echo -e "\033[0;32mNVM installed ✓\033[0m\n"
# include nvm
. ~/.nvm/nvm.sh
fi
# include nvm
. ~/.nvm/nvm.sh
echo -e "\033[0;34mInstall Node...\033[0m\n"
echo -e "\033[0;34mInstall Node ${nodeversion}...\033[0m\n"
# include version config
. ./core/node.sh
# set node version
nvm install ${nodeversion}
# nvm-windows won't set the version by default after installing it
if [ $OSTYPE == "msys" ]
then
nvm use ${nodeversion}
fi
echo -e "\033[0;32mNode installed ✓\033[0m\n"
# install node deps
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment