1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-08 19:52:36 +01:00

🎨 improve setup script

This commit is contained in:
Flam3rboy 2021-02-04 16:26:04 +01:00
parent e876659b4b
commit c68caa940d
2 changed files with 62 additions and 33 deletions

View File

@ -4,37 +4,64 @@ ECHO Discord-Open-Source-Installer
ECHO v0.1 ~xnacly
ECHO.
ECHO str+c/str+d to exit
ECHO 1: /discord-dashboard.git
ECHO 2: /discord-api.git
ECHO 3: /discord-cdn.git
ECHO 4: /discord-client.git
ECHO 5: /discord-react-native.git
ECHO 6: /discord-react.git
ECHO 7: /discord-css.git
ECHO 8: /discord-gateway.git
ECHO A: all of the above
ECHO.
CHOICE /c 1234567a /m "decide what repos to install"
ECHO This will clone and setup all repositories,
ECHO if you only want to work on one specific repository
ECHO follow their specific Getting Started Guide and exit this script
ECHO.
CHOICE /C YN /m "Are you sure you want to continue (y/n)?"
IF %ERRORLEVEL% == 2 GOTO :end
where /q git
IF ERRORLEVEL 1 (
ECHO Error: git is not installed.
ECHO Please Install git from: https://git-scm.com/downloads
ECHO And make sure its in the path
GOTO :end
)
IF %ERRORLEVEL% ==A GOTO ALL
::IF ERRORLEVEL ==1
::IF ERRORLEVEL ==2
::IF ERRORLEVEL ==3
::IF ERRORLEVEL ==4
::IF ERRORLEVEL ==5
::IF ERRORLEVEL ==6
::IF ERRORLEVEL ==7
where /q node
IF ERRORLEVEL 1 (
ECHO Error: node is not installed.
ECHO Please Install NodeJS from: https://nodejs.org/en/download/
ECHO And make sure its in the path
GOTO :end
)
:ALL
cd ..
mkdir discord-open-source-repos
cd discord-open-source-repos
git clone https://github.com/discord-open-source/discord-dashboard.git
git clone https://github.com/discord-open-source/discord-api.git
git clone https://github.com/discord-open-source/discord-gateway.git
git clone https://github.com/discord-open-source/discord-cdn.git
git clone https://github.com/discord-open-source/discord-client.git
git clone https://github.com/discord-open-source/discord-react-native.git
git clone https://github.com/discord-open-source/discord-react.git
git clone https://github.com/discord-open-source/discord-css.git
where /q npm
IF ERRORLEVEL 1 (
ECHO 'Error: npm is not installed.' >&2
ECHO Please install npm from: https://nodejs.org/en/download/
ECHO And make sure its in the path
GOTO :end
)
echo Dependencies are already Installed
ECHO.
echo Creating organization directory
ECHO.
CD ..\..\
MKDIR discord-open-source-workspace
cd discord-open-source-workspace
ECHO Cloning all repositories
ECHO.
git clone https://github.com/discord-open-source/discord-api api
git clone https://github.com/discord-open-source/discord-gateway gateway
git clone https://github.com/discord-open-source/discord-voice voice
git clone https://github.com/discord-open-source/discord-cdn cdn
git clone https://github.com/discord-open-source/discord-css design
git clone https://github.com/discord-open-source/discord-client client
git clone https://github.com/discord-open-source/discord-react react
git clone https://github.com/discord-open-source/discord-react-native react-native
git clone https://github.com/discord-open-source/discord-dashboard dashboard
where /q code
IF ERRORLEVEL 0 (
echo {"folders":[{"path":"cdn"},{"path":"api"},{"path":"gateway"},{"path":"voice"},{"path":"design"},{"path":"react"},{"path":"client"},{"path":"react-native"},{"path":"dashboard"}]}> discord-open-source.code-workspace
ECHO Opening VSCode Workspace
code discord-open-source.code-workspace
)
:end
@ECHO on
PAUSE

View File

@ -15,13 +15,13 @@ fi
echo ---------------------
echo Checking dependencies
if ! [ -x "$(command -v git)" ]; then
echo 'Error: git is not installed.' >&2
echo Error: git is not installed.
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
echo 'Error: node is not installed.' >&2
echo Error: node is not installed.
echo Please Install NodeJS from: https://nodejs.org/en/download/
echo And make sure its in the path
exit 1
@ -32,7 +32,7 @@ if ! [ -x "$(command -v npm)" ]; then
echo And make sure its in the path
exit 1
fi
echoAll Dependencies Installed
echo ✓ Dependencies are already Installed
echo -------------------------------
echo Creating organization directory
cd ../../
@ -41,6 +41,7 @@ mkdir discord-open-source
mv overview discord-open-source/
cd discord-open-source
echo Cloning all repositories
git clone https://github.com/discord-open-source/discord-api api
git clone https://github.com/discord-open-source/discord-gateway gateway
git clone https://github.com/discord-open-source/discord-voice voice
@ -50,6 +51,7 @@ git clone https://github.com/discord-open-source/discord-client client
git clone https://github.com/discord-open-source/discord-react react
git clone https://github.com/discord-open-source/discord-react-native react-native
git clone https://github.com/discord-open-source/discord-dashboard dashboard
if [ -x "$(command -v code)" ]; then
echo '{"folders":[{"path":"overview"},{"path":"cdn"},{"path":"api"},{"path":"gateway"},{"path":"voice"},{"path":"design"},{"path":"react"},{"path":"client"},{"path":"react-native"},{"path":"dashboard"}]}' >> discord-open-source.code-workspace
echo Open VSCode Workspace