Skip to content

Commit

Permalink
Add contribution guidelines and link in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarxzer committed Mar 16, 2024
2 parents a3e4e77 + c0db110 commit 38a2ee7
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 31 deletions.
78 changes: 78 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Contributing to ComputerCraft : Tweaked Blockly Editor

Thank you for your interest in contributing to ComputerCraft : Tweaked Blockly Editor! Follow these steps to contribute to the project:

## 1. Fork the Repository
- Go to the [GitHub repository](https://github.com/Sarxzer/cc-tweaked_blockly.git).
- Click on the "Fork" button in the top right corner to create a copy of the repository in your GitHub account.

## 2. Clone the Forked Repository
- Open your terminal or command prompt.
- Clone your forked repository to your local machine. Replace `<your-username>` with your GitHub username.
```bash
git clone https://github.com/<your-username>/cc-tweaked_blockly.git
```
- Navigate into the cloned repository:
```bash
cd cc-tweaked_blockly
```

## 3. Set Up Remote
- Add the original repository as a remote, this will allow you to fetch changes from the original repository.
```bash
git remote add upstream https://github.com/Sarxzer/cc-tweaked_blockly.git
```

## 4. Create a New Branch
- Create a new branch for your changes. It's a good practice to name your branch based on the feature or fix you're working on.
```bash
git checkout -b <branch-name>
```

## 5. Install Packages
- Download Node.js and npm
- Launch `package_installer.bat`
- If you are encountering unexpected error, please make an issue on Github

## 6. Make Changes
- Make the necessary changes to the project using your preferred text editor or IDE.

## 7. Test your change
- Just do
```bash
npm start
```

## 8. Stage and Commit Changes
- Stage the changes you've made.
```bash
git add .
```
- Commit the changes with a descriptive commit message.
```bash
git commit -m "Add feature: <description>"
```

## 9. Push Changes to Your Fork
- Push your changes to your forked repository on GitHub.
```bash
git push origin <branch-name>
```

## 10. Create a Pull Request
- Visit your forked repository on GitHub.
- Click on the "Compare & pull request" button next to the branch you just pushed.
- Provide a descriptive title and comment for your pull request.
- Click on the "Create pull request" button to submit your changes for review.
- We will review your pull request and see if we can merged it with the original repository.

## 11. Keep Your Fork Updated (Optional)
- To keep your fork updated with the original repository, fetch changes from the upstream repository and merge them into your local master branch.
```bash
git fetch upstream
git checkout master
git merge upstream/master
git push origin master
```

That's it! Your pull request will now be reviewed by the project maintainers. Be sure to respond to any feedback they provide and make any necessary changes to your pull request. Once approved, your changes will be merged into the main project.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ We stoped doing Windows installer because our application is lightweight and the
3. Export the code to ComputerCraft:Tweaked
4. Run the code in the game

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request
## [Contributing](https://github.com/Sarxzer/cc-tweaked_blockly/blob/main/CONTRIBUTE.md)

## History

Expand Down
56 changes: 32 additions & 24 deletions package_installer.bat
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
#!/bin/bash
@echo off
setlocal

# Specify the package names
package_names=("blockly" "@blockly/shadow-block-converter")
rem Specify the package names
set "package_names=blockly @blockly/shadow-block-converter"

# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "Node.js is not installed. Please install Node.js before running this script."
exit 1
fi
rem Check if Node.js is installed
where node >nul 2>nul
if %errorlevel% neq 0 (
echo Node.js is not installed. Please install Node.js before running this script.
pause
exit /b 1
)

# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "npm is not installed. Please install npm before running this script."
exit 1
fi
rem Check if npm is installed
where npm >nul 2>nul
if %errorlevel% neq 0 (
echo npm is not installed. Please install npm before running this script.
pause
exit /b 1
)

# Loop over the array and install each package
for package_name in "${package_names[@]}"; do
echo "Installing $package_name..."
npm install $package_name
rem Loop over the array and install each package
for %%i in (%package_names%) do (
echo Installing %%i...
npm install %%i

# Check if the installation was successful
if [ $? -eq 0 ]; then
echo "Package $package_name has been successfully installed."
else
echo "Failed to install package $package_name."
fi
done
rem Check if the installation was successful
if %errorlevel% equ 0 (
echo Package %%i has been successfully installed.
) else (
echo Failed to install package %%i.
)
)

pause
endlocal

0 comments on commit 38a2ee7

Please sign in to comment.