Skip to content

Commit

Permalink
Merge pull request #1 from BEComTweaks/update-for-one-dot-twenty-one
Browse files Browse the repository at this point in the history
update for stuff
  • Loading branch information
yzabeast1 authored Jul 26, 2024
2 parents 5ec01cc + 8ab698c commit db04c72
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div align="center">

# BEComTweaks/server-backend

![Commit Activity](https://img.shields.io/github/commit-activity/w/BEComTweaks/server-backend?style=for-the-badge&label=Commits&color=purple)
![GitHub repo size](https://img.shields.io/github/repo-size/BEComTweaks/server-backend?style=for-the-badge&label=Size&color=pink)
</div>

Server Backend for the website

To clone
```cmd
git clone https://github.com/BEComTweaks/server-backend --recursive
```
<sub> Recursive is neccessary due to submodules</sub>

To start server
```cmd
node server.js
```
<sub> On linux and mac run this command with sudo or a program like authbind to allow usage of ports below 1024
Then just go to the local website and download your packs! It will use localhost instead of the actual server ip
5 changes: 2 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ function listOfFromDirectories(selectedPacks, type) {

for (let category in selPacks) {
if (category !== "raw") {
const ctopic = loadJson(`${cdir(type)}/jsons/packs/${category.replace(' ', '_').replace(' ', '_').toLowerCase()}.json`);
const nameToJson = loadJson(`${cdir(type)}/jsons/others/name_to_json.json`);
const ctopic = loadJson(`${cdir(type)}/jsons/packs/${nameToJson[category]}`);
selPacks[category].packs.forEach((pack, index) => {
let compatible = false;
if (addedPacks.includes(ctopic.packs[selPacks[category].index[index]].pack_id)) {
Expand Down Expand Up @@ -176,8 +177,6 @@ function mainCopyFile(fromDir) {
} else if (item.endsWith('.lang')) {
const fromLang = fs.readFileSync(path.join(fromDir, item), 'utf-8');
fs.appendFileSync(targetPath, `\n${fromLang}`);
} else {
console.log(`${path.join(fromDir, item)} cannot be copied to ${targetPath} as it cannot be merged`);
}
} else {
fs.copyFileSync(path.join(fromDir, item), targetPath);
Expand Down

0 comments on commit db04c72

Please sign in to comment.