Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Create install.bat #4

Merged
merged 3 commits into from
Jul 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update install.bat
  • Loading branch information
derNiklaas authored Jul 26, 2019
commit 1d07d170f297d2d199f48b95ec437c0c7a7480bf
38 changes: 25 additions & 13 deletions install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,30 @@ IF "%MISSING_REQUIREMENT%"=="true" (
ECHO * All requirements are installed
)

SET "npm=true"
SET "yarn=true"
CALL :check_optional_requirement yarn
IF "%MISSING_REQUIREMENT%"=="true" (
SET "MISSING_REQUIREMENT=false"
CALL :check_optional_requirement npm
IF "%MISSING_REQUIREMENT%"=="true" (
ECHO ! NPM or yarn is needed to set up webui
PAUSE
exit /b
) ELSE (
SET "yarn=false"
)
ECHO * Note: Yarn is not installed.
SET "yarn=false"
)

set "MISSING_REQUIREMENT=false"
CALL :check_optional_requirement npm
IF "%MISSING_REQUIREMENT%"=="true" (
ECHO * Note: npm is not installed.
SET "npm=false"
)

IF "%npm%"=="false" (
IF "%yarn%"=="false" (
ECHO ! NPM or yarn is needed to set up webui
PAUSE
exit /b
)
)


CALL :check_folder chatoverflow https://github.com/codeoverflow-org/chatoverflow chatoverflow
CALL :check_folder chatoverflow/api https://github.com/codeoverflow-org/chatoverflow-api chatoverflow/api
CALL :check_folder chatoverflow/gui https://github.com/codeoverflow-org/chatoverflow-gui chatoverflow/gui
Expand All @@ -35,23 +45,25 @@ cd chatoverflow/
SET "MISSING_REQUIREMENT=false"
CALL :check_optional_requirement sbt
IF "%MISSING_REQUIREMENT%"=="true" (
echo ! We would love to set the project up for you, but it seems like you don't have sbt installed.
echo ! Please install sbt and execute $ sbt ';update;fetch;update'
echo ! Or follow the guide at https://github.com/codeoverflow-org/chatoverflow/wiki/Installation
ECHO ! We would love to set the project up for you, but it seems like you don't have sbt installed.
ECHO ! Please install sbt and execute $ sbt ';update;fetch;update'
ECHO ! Or follow the guide at https://github.com/codeoverflow-org/chatoverflow/wiki/Installation
) ELSE (
ECHO * Found sbt.
sbt ";update;fetch;update"
)

cd gui/

ECHO * Installing GUI (this may take a while...)

IF "%yarn%"=="true" (
yarn
) ELSE (
npm install
)

echo * Success! You can now open the project in IntelliJ (or whatever IDE you prefer)
ECHO * Success! You can now open the project in IntelliJ (or whatever IDE you prefer)


PAUSE
Expand Down