60 lines
1.7 KiB
Bash
Raw Normal View History

2021-04-29 10:16:52 +08:00
#!/bin/sh
cat fosscord.txt
echo
2021-04-29 10:16:52 +08:00
cat << EOF
--------------------------------------
2021-05-01 16:10:57 +02:00
Fosscord Open Source Contribution Setup
2021-04-29 10:16:52 +08:00
strg+c/strg+d to exit
-------------------------------------------
This will clone and setup all repositories,
if you only want to work on one specific repository
follow their specific Getting Started Guide and exit this script
----------------------------------------------------------------
EOF
2021-05-01 17:56:39 +02:00
printf "Are you sure you want to continue (y/N)?"
2021-02-04 11:02:07 +01:00
read -p "" CONT
if [ "$CONT" != "y" ]; then
echo Aborting setup
exit 1
fi
echo ---------------------
echo Checking dependencies
if ! [ -x "$(command -v git)" ]; then
2021-02-04 16:26:04 +01:00
echo Error: git is not installed.
2021-02-04 11:02:07 +01:00
echo Please Install git from: https://git-scm.com/downloads
echo And make sure its in the path
exit 1
fi
if ! [ -x "$(command -v node)" ]; then
2021-02-04 16:26:04 +01:00
echo Error: node is not installed.
2021-05-01 16:26:50 +02:00
echo Please Install NodeJS from: https://nodejs.org/en/download
2021-02-04 11:02:07 +01:00
echo And make sure its in the path
exit 1
fi
2021-05-01 16:41:36 +02:00
if ! [ -x "$(command -v npm)" ]; then
2021-02-04 11:02:07 +01:00
echo 'Error: npm is not installed.' >&2
2021-05-01 16:26:50 +02:00
echo Please install npm from: https://nodejs.org/en/download
2021-02-04 11:02:07 +01:00
echo And make sure its in the path
exit 1
fi
2021-05-01 16:10:57 +02:00
echo ✓ Dependencies are already installed
2021-02-04 11:02:07 +01:00
echo -------------------------------
echo Creating organization directory
mkdir fosscord
cd fosscord
2021-02-04 11:02:07 +01:00
echo Cloning all repositories
2021-02-04 16:26:04 +01:00
sh ../clone_all_repos.sh
mv ../fosscord.code-workspace ./fosscord.code-workspace
while true; do
echo "Do you wish to launch the VSCode workspace?"
read -p "[y/n]: " yn
2021-05-01 17:04:33 +02:00
case $yn in
[Yy]* ) echo Opening VS Code Workspace ; code fosscord.code-workspace ; break;;
[Nn]* ) break;;
2021-05-01 17:04:33 +02:00
esac
done
2021-05-01 16:41:36 +02:00
echo Installation finished