Commit e300197e authored by Aral Balkan's avatar Aral Balkan

Convert tabs to spaces

parent 38346ddc
Pipeline #862 canceled with stages
......@@ -2,17 +2,17 @@
################################################################################
#
# Better
# Better
#
# Installation script.
# Installation script.
#
# This is Independent Technology.
# This is Independent Technology.
#
# ▲❤ We practice Ethical Design (https://ind.ie/ethical-design)
# ▲❤ We practice Ethical Design (https://ind.ie/ethical-design)
#
# © Aral Balkan. © Ind.ie. All Rights Reserved.
# Released with love by Ind.ie under GNU AGPLv3 or later.
# Free as in freedom. Please see the LICENSE file.
# © Aral Balkan. © Ind.ie. All Rights Reserved.
# Released with love by Ind.ie under GNU AGPLv3 or later.
# Free as in freedom. Please see the LICENSE file.
#
################################################################################
......@@ -30,99 +30,99 @@ accountName='better'
#
ensureCoffeeScriptExists(){
if hash coffee 2>/dev/null; then
echo -e "CoffeeScript already installed, skipping installation.\n"
else
npm install -g coffee-script
fi
if hash coffee 2>/dev/null; then
echo -e "CoffeeScript already installed, skipping installation.\n"
else
npm install -g coffee-script
fi
}
ensureNodemonExists(){
if hash nodemon 2>/dev/null; then
echo -e "Global module nodemon already installed, skipping installation.\n"
else
npm install -g nodemon
fi
if hash nodemon 2>/dev/null; then
echo -e "Global module nodemon already installed, skipping installation.\n"
else
npm install -g nodemon
fi
}
npmInstall(){
# Install npm modules
npm install
# Install npm modules
npm install
}
configureLocalEnvironment(){
#
# Set up the local configuration.
#
#
# Set up the local configuration.
#
readonly ROOT=~/better.fyi
readonly ROOT=~/better.fyi
if ! [ -d $ROOT ]; then
# The main better components/content directory does not exist, create it.
mkdir $ROOT
fi
if ! [ -d $ROOT ]; then
# The main better components/content directory does not exist, create it.
mkdir $ROOT
fi
readonly privateFolder=$ROOT/.private
readonly privateFolder=$ROOT/.private
if ! [ -d $privateFolder ]; then
mkdir $privateFolder
fi
if ! [ -d $privateFolder ]; then
mkdir $privateFolder
fi
# Make a symbolic link from the main directory for easy access.
if ! [ -d ../.private ]; then ln -s ~/better.fyi/.private ../.private; fi
# Make a symbolic link from the main directory for easy access.
if ! [ -d ../.private ]; then ln -s ~/better.fyi/.private ../.private; fi
#
# Copy placeholders
#
#
# Copy placeholders
#
# Copy placeholder global statistics file.
# Copy placeholder global statistics file.
# This is used by the builder when generating the statistics for the
# home page. However, it needs to be generated by the Inspector which,
# at this point, has not been installed yet. Since Inspector requires
# a valid build to run, to avoid a Catch-22, we place a placeholder
# statistics file to be used on the first build of the Builder.
#
cp _install/placeholders/statistics.json ~/better.fyi/.private/
# This is used by the builder when generating the statistics for the
# home page. However, it needs to be generated by the Inspector which,
# at this point, has not been installed yet. Since Inspector requires
# a valid build to run, to avoid a Catch-22, we place a placeholder
# statistics file to be used on the first build of the Builder.
#
cp _install/placeholders/statistics.json ~/better.fyi/.private/
# Ensure dist folder exists
mkdir -p dist
# Ensure dist folder exists
mkdir -p dist
#
# Create the cache directory, if it doesn’t already exist.
#
#
# Create the cache directory, if it doesn’t already exist.
#
readonly cacheFolder=$privateFolder/cache
readonly cacheFolder=$privateFolder/cache
if ! [ -d $cacheFolder ]; then
mkdir $cacheFolder
fi
if ! [ -d $cacheFolder ]; then
mkdir $cacheFolder
fi
}
greetings(){
echo -e "Setting up the Better Builder development environment."
echo -e "Setting up the Better Builder development environment."
}
goodbye(){
echo -e "Better Builder successfully installed."
exit 0
echo -e "Better Builder successfully installed."
exit 0
}
ensureDependenciesExist(){
ensureCoffeeScriptExists
ensureNodemonExists
ensureCoffeeScriptExists
ensureNodemonExists
}
installSelf(){
npmInstall
configureLocalEnvironment
npmInstall
configureLocalEnvironment
}
#
......@@ -130,11 +130,11 @@ installSelf(){
#
main(){
getAccountName
greetings
ensureDependenciesExist
installSelf
goodbye
getAccountName
greetings
ensureDependenciesExist
installSelf
goodbye
}
main
Markdown is supported
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