forked from BuildCLI/BuildCLI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'BuildCLI:main' into feature/Auto-Assign-Issues-Based-on…
…-Specific-Comments
- Loading branch information
Showing
3 changed files
with
128 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@echo off | ||
setlocal | ||
|
||
echo Cloning the BuildCLI repository... | ||
git clone https://github.com/BuildCLI/BuildCLI.git || ( | ||
echo Failed to clone repository. Make sure Git is installed. | ||
pause | ||
exit /b 1 | ||
) | ||
|
||
cd BuildCLI || ( | ||
echo Directory 'BuildCLI' not found. Cloning may have failed. | ||
pause | ||
exit /b 1 | ||
) | ||
|
||
echo Checking if Maven is installed... | ||
where mvn >nul 2>nul | ||
if %errorlevel% neq 0 ( | ||
echo Maven not found. Please install Maven. | ||
pause | ||
exit /b 1 | ||
) | ||
|
||
echo Checking if Java is installed... | ||
where java >nul 2>nul | ||
if %errorlevel% neq 0 ( | ||
echo Java not found. Please install Java. | ||
pause | ||
exit /b 1 | ||
) | ||
|
||
echo Building and packaging the project... | ||
mvn clean package || ( | ||
echo Maven build failed. | ||
pause | ||
exit /b 1 | ||
) | ||
|
||
echo Configuring BuildCLI for global access... | ||
|
||
if not exist %USERPROFILE%\bin ( | ||
echo Creating directory %USERPROFILE%\bin... | ||
mkdir %USERPROFILE%\bin | ||
) | ||
|
||
echo Copying BuildCLI JAR to %USERPROFILE%\bin... | ||
copy target\buildcli.jar %USERPROFILE%\bin\buildcli.jar | ||
|
||
echo Creating buildcli.bat shortcut... | ||
( | ||
echo @echo off | ||
echo java -jar "%%USERPROFILE%%\bin\buildcli.jar" %%* | ||
) > %USERPROFILE%\bin\buildcli.bat | ||
|
||
echo Ensuring %USERPROFILE%\bin is in the PATH... | ||
echo If the command fails, add this manually to your environment variables: | ||
echo. | ||
echo setx PATH "%PATH%;%USERPROFILE%\bin" | ||
echo. | ||
|
||
echo Installation completed! | ||
echo You can now run BuildCLI using: | ||
echo buildcli | ||
pause | ||
endlocal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function check_command() { | ||
if ! command -v "$1" &> /dev/null; then | ||
echo "$1 is not installed, please install it before proceeding." | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_command java | ||
check_command mvn | ||
|
||
if ! git clone https://github.com/BuildCLI/BuildCLI.git ; then | ||
echo "Failed to clone repository. Make sure Git is installed." | ||
exit 1 | ||
fi | ||
cd BuildCLI | ||
|
||
if ! mvn clean package; then | ||
echo "Error while creating Maven package." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "$HOME/bin" ]; then | ||
mkdir -p "$HOME/bin" | ||
fi | ||
|
||
cp target/buildcli.jar "$HOME/bin/" | ||
|
||
cat <<EOF > "$HOME/bin/buildcli" | ||
#!/bin/bash | ||
java -jar "\$HOME/bin/buildcli.jar" "\$@" | ||
EOF | ||
|
||
chmod +x "$HOME/bin/buildcli" | ||
|
||
if [[ ":$PATH:" != *":$HOME/bin:"* ]]; then | ||
echo "The directory \$HOME/bin is not in the PATH." | ||
echo "Please add the following line to your ~/.bashrc, ~/.zshrc, or the appropriate shell configuration file:" | ||
echo "" | ||
echo 'export PATH="$HOME/bin:$PATH"' | ||
echo "" | ||
echo "Then, reload your shell with:" | ||
echo "source ~/.bashrc # or source ~/.zshrc if you use Zsh" | ||
echo "" | ||
echo "After that, you can run the application with: buildcli" | ||
else | ||
echo "You can now run the application with: buildcli" | ||
fi | ||
|