1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-22 02:12:30 +01:00

Merge pull request #30 from Stylix58/master

Improve scripts (with npm and discord rpc)
This commit is contained in:
Flam3rboy 2021-05-01 18:28:58 +02:00 committed by GitHub
commit 5fb6b07629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 77 additions and 46 deletions

View File

@ -1,17 +1,19 @@
## Getting Started
# Getting Started
## Without automated scripts
### Windows
1. Open up a Terminal.
2. Type this command: `curl https://raw.githubusercontent.com/fosscord/fosscord/main/scripts/setup/setup.bat --output setup.bat && setup.bat`.
to setup all repositories open cmd and enter this to command
### Posix systems (MacOS, Linux...)
1. Open up a Terminal.
2. Type this command: `curl https://raw.githubusercontent.com/fosscord/fosscord/main/scripts/setup/setup.sh --output setup.sh && sh setup.sh`.
```
curl https://raw.githubusercontent.com/fosscord/fosscord/main/scripts/setup/setup.bat --output setup.bat && setup.bat
```
## With automated scripts
This method need to have [Git](https://git-scm.com) installed.
### Windows
1. Open up a Terminal.
2. Type this command: `git clone https://github.com/fosscord/fosscord && .\scripts\setup\setup.bat`.
### Linux/MacOS
to setup all repositories open the terminal and enter this to command
```
curl https://raw.githubusercontent.com/fosscord/fosscord/main/scripts/setup/setup.sh --output setup.sh && bash setup.sh
```
### Posix systems (MacOS, Linux...)
1. Open up a Terminal.
2. Type this command: `git clone https://github.com/fosscord/fosscord && sh ./scripts/setup/setup.sh`.

View File

@ -27,7 +27,7 @@ IF ERRORLEVEL 1 (
where /q node
IF ERRORLEVEL 1 (
ECHO Error: node is not installed.
ECHO Please Install NodeJS from: https://nodejs.org/en/download/
ECHO Please Install NodeJS from: https://nodejs.org/en/download
ECHO And make sure its in the path
GOTO :end
)
@ -35,11 +35,11 @@ IF ERRORLEVEL 1 (
where /q npm
IF ERRORLEVEL 1 (
ECHO 'Error: npm is not installed.' >&2
ECHO Please install npm from: https://nodejs.org/en/download/
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 Dependencies are already installed
ECHO.
echo Creating organization directory
ECHO.
@ -66,20 +66,19 @@ git clone https://github.com/fosscord/react-native-withcss react-native-withcss
echo {"folders":[{"path":"overview"},{"path":"cdn"},{"path":"api"},{"path":"gateway"},{"path":"media"},{"path":"server-util"},{"path":"ui"},{"path":"client"},{"path":"plugins"},{"path":"themes"},{"path":"landingpage"},{"path":"dashboard"},{"path":"support"},{"path":"css-mediaquery"},{"path":"react-native-withcss"}]}> fosscord.code-workspace
where /q code
IF ERRORLEVEL 0 (
ECHO Opening VSCode Workspace
CHOICE /c yn /m "Do you want to launch the VS Code workspace?"
IF %ERRORLEVEL% == 2 GOTO :rpc
ECHO Opening VS Code Workspace
code fosscord.code-workspace
)
:rpc
CHOICE /c yn /m "Do you want to install the Discord Rich Presence?"
IF %ERRORLEVEL% == 2 GOTO :end
cd ..
cd rpc
npm install
npm i pm2 -g

View File

@ -1,7 +1,7 @@
#!/bin/sh
cat << EOF
--------------------------------------
Discord Open Source Contribution Setup
Fosscord Open Source Contribution Setup
strg+c/strg+d to exit
-------------------------------------------
This will clone and setup all repositories,
@ -9,7 +9,7 @@ if you only want to work on one specific repository
follow their specific Getting Started Guide and exit this script
----------------------------------------------------------------
EOF
printf "Are you sure you want to continue (y/N)? "
printf "Are you sure you want to continue (y/N)?"
read -p "" CONT
if [ "$CONT" != "y" ]; then
echo Aborting setup
@ -25,17 +25,17 @@ if ! [ -x "$(command -v git)" ]; then
fi
if ! [ -x "$(command -v node)" ]; then
echo Error: node is not installed.
echo Please Install NodeJS from: https://nodejs.org/en/download/
echo Please Install NodeJS from: https://nodejs.org/en/download
echo And make sure its in the path
exit 1
fi
if ! [ -x "$(command -v npm)" ]; then
echo 'Error: npm is not installed.' >&2
echo Please install npm from: https://nodejs.org/en/download/
echo Please install npm from: https://nodejs.org/en/download
echo And make sure its in the path
exit 1
fi
echo ✓ Dependencies are already Installed
echo ✓ Dependencies are already installed
echo -------------------------------
echo Creating organization directory
mkdir fosscord
@ -61,7 +61,12 @@ git clone https://github.com/fosscord/react-native-withcss react-native-withcss
echo '{"folders":[{"path":"overview"},{"path":"cdn"},{"path":"api"},{"path":"gateway"},{"path":"media"},{"path":"server-util"},{"path":"ui"},{"path":"client"},{"path":"plugins"},{"path":"themes"},{"path":"landingpage"},{"path":"dashboard"},{"path":"support"},{"path":"css-mediaquery"},{"path":"react-native-withcss"}]}' >> fosscord.code-workspace
if [ -x "$(command -v code)" ]; then
echo Open VSCode Workspace
code fosscord.code-workspace
fi
echo "Do you want to launch VS Code workspace?"
select yn in "y" "n"; do
case $yn in
Yes ) echo Opening VS Code Workspace ; code fosscord.code-workspace ; break;;
No ) break;;
esac
done
echo Installation finished

View File

@ -0,0 +1,3 @@
@ECHO off
.\update-git.bat
.\update-npm.bat

View File

@ -0,0 +1,2 @@
sh update-git.sh
sh update-npm.sh

View File

@ -0,0 +1,5 @@
@ECHO off
ECHO Update for Git...
cd ..\..
FOR /D %%a IN (%CD%\fosscord\*) do echo -------------- && echo %%~fa && cd %%~fa && git sync
@ECHO on

View File

@ -0,0 +1,9 @@
echo Update files...
cd ../..
for D in */; do
echo --------------
echo "$D";
cd $D
git sync
cd ..
done

View File

@ -0,0 +1,9 @@
@ECHO off
ECHO Update all dependencies...
where /q pnpm
IF ERRORLEVEL 1 (
FOR /D %%a IN (%CD%\fosscord\*) do echo -------------- && echo %%~fa && cd %%~fa && npm i
) ELSE (
FOR /D %%a IN (%CD%\fosscord\*) do echo -------------- && echo %%~fa && cd %%~fa && pnpm i
)
@ECHO on

View File

@ -0,0 +1,13 @@
echo Update all dependancies...
cd ../..
for D in */; do
echo --------------
echo "$D";
cd $D
if [ $pnpm = true ]
if ! [ -x "$(command -v pnpm)" ]; then
npm i
else
pnpm i
fi
done

View File

@ -1,5 +0,0 @@
@ECHO off
ECHO Update...
cd ..\..\..\
FOR /D %%a IN (%CD%\fosscord-workspace\*) do git -C %%~fa pull && npm i
PAUSE

View File

@ -1,11 +0,0 @@
echo Update all repositories ...
cd ../../../
for D in */; do
echo --------------
echo "$D";
cd $D
git pull
npm i
cd ..
done
echo Done