From 7030ed865087be4a0fa41c02eac777b71edb6da5 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:49:27 -0500 Subject: [PATCH 1/4] [NAK_CVR_Mods] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 76c86ad..5fa34df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## NotAKids ChilloutVR Mods + + ## Released Mods | Mod Name | README | Download | Description | @@ -37,6 +39,8 @@ | VisualCloneFix | [README](https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/VisualCloneFix) | [Download](https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/latest/download/VisualCloneFix.dll) | Fixes the Visual Clone system. | | WhereAmIPointing | [README](https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/WhereAmIPointing) | [Download](https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/latest/download/WhereAmIPointing.dll) | Makes your controller rays always visible when the menus are open. | + + # How To Install The majority of modifications found in this repository are reviewed and made available through the [ChilloutVR Modding Group](https://discord.gg/dndGPM3bxu). From 0564de3ebfade2fed62d134f6ad94b5465db74ab Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:52:32 -0500 Subject: [PATCH 2/4] [NAK_CVR_Mods] Experiment --- .github/scripts/update-modlist.js | 55 ++++++++++++++++++++++++++++ .github/workflows/update-modlist.yml | 34 +++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/scripts/update-modlist.js create mode 100644 .github/workflows/update-modlist.yml diff --git a/.github/scripts/update-modlist.js b/.github/scripts/update-modlist.js new file mode 100644 index 0000000..2e5c55d --- /dev/null +++ b/.github/scripts/update-modlist.js @@ -0,0 +1,55 @@ +const fs = require('fs'); +const path = require('path'); + +const ROOT = '.'; +const EXPERIMENTAL = '.Experimental'; +const README_PATH = 'README.md'; +const MARKER_START = ''; +const MARKER_END = ''; + +function getModFolders(baseDir) { + const entries = fs.readdirSync(baseDir, { withFileTypes: true }); + return entries + .filter(entry => entry.isDirectory()) + .map(entry => path.join(baseDir, entry.name)) + .filter(dir => fs.existsSync(path.join(dir, 'README.md'))); +} + +function formatTable(mods, baseDir) { + if (mods.length === 0) return ''; + + let rows = mods.map(modPath => { + const modName = path.basename(modPath); + const readmeLink = path.join(modPath, 'README.md'); + const zipLink = path.join(modPath, `${modName}.zip`); + return `| [${modName}](${readmeLink}) | [Download](${zipLink}) |`; + }); + + return [ + `### ${baseDir === EXPERIMENTAL ? 'Experimental Mods' : 'Released Mods'}`, + '', + '| Name | Download |', + '|------|----------|', + ...rows, + '' + ].join('\n'); +} + +function updateReadme(modListSection) { + const readme = fs.readFileSync(README_PATH, 'utf8'); + const before = readme.split(MARKER_START)[0]; + const after = readme.split(MARKER_END)[1]; + + const newReadme = `${before}${MARKER_START}\n\n${modListSection}\n${MARKER_END}${after}`; + fs.writeFileSync(README_PATH, newReadme); +} + +const mainMods = getModFolders(ROOT).filter(dir => !dir.startsWith(EXPERIMENTAL)); +const experimentalMods = getModFolders(EXPERIMENTAL); + +const tableContent = [ + formatTable(mainMods, ROOT), + formatTable(experimentalMods, EXPERIMENTAL) +].join('\n'); + +updateReadme(tableContent); \ No newline at end of file diff --git a/.github/workflows/update-modlist.yml b/.github/workflows/update-modlist.yml new file mode 100644 index 0000000..73d8919 --- /dev/null +++ b/.github/workflows/update-modlist.yml @@ -0,0 +1,34 @@ +name: Update Mod List in README + +on: + push: + paths: + - '**/README.md' + - '.github/workflows/update-modlist.yml' + workflow_dispatch: + +jobs: + update-readme: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install dependencies + run: npm install gray-matter + + - name: Generate mod list + run: node .github/scripts/update-modlist.js + + - name: Commit changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add README.md + git commit -m "[NAK_CVR_Mods] Update mod list in README" || echo "No changes to commit" + git push From 68d7c22b7c54430ec9e54573cee97e11da3eb66f Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Wed, 9 Apr 2025 16:02:53 -0500 Subject: [PATCH 3/4] [NAK_CVR_Mods] Experiment 2 --- .github/workflows/update-modlist.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-modlist.yml b/.github/workflows/update-modlist.yml index 73d8919..2b117fb 100644 --- a/.github/workflows/update-modlist.yml +++ b/.github/workflows/update-modlist.yml @@ -1,34 +1,35 @@ -name: Update Mod List in README +name: Update Mod List on: push: paths: - - '**/README.md' + - 'scripts/update_modlist.py' - '.github/workflows/update-modlist.yml' + - 'README.md' + - '**/README.md' workflow_dispatch: jobs: - update-readme: + update-modlist: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo + uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 + - name: Set up Python + uses: actions/setup-python@v5 with: - node-version: '20' + python-version: '3.x' - - name: Install dependencies - run: npm install gray-matter + - name: Run mod list updater + run: python scripts/update_modlist.py - - name: Generate mod list - run: node .github/scripts/update-modlist.js - - - name: Commit changes + - name: Commit and push changes run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }} git add README.md git commit -m "[NAK_CVR_Mods] Update mod list in README" || echo "No changes to commit" git push From dafff6a9a2d31d7c54e36d3e89a6ccd5d661913f Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Wed, 9 Apr 2025 16:05:01 -0500 Subject: [PATCH 4/4] [NAK_CVR_Mods] trust --- .github/workflows/update-modlist.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-modlist.yml b/.github/workflows/update-modlist.yml index 2b117fb..3376080 100644 --- a/.github/workflows/update-modlist.yml +++ b/.github/workflows/update-modlist.yml @@ -3,7 +3,7 @@ name: Update Mod List on: push: paths: - - 'scripts/update_modlist.py' + - 'update-modlist.js' - '.github/workflows/update-modlist.yml' - 'README.md' - '**/README.md' @@ -17,13 +17,13 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up Node.js + uses: actions/setup-node@v3 with: - python-version: '3.x' + node-version: '20' - name: Run mod list updater - run: python scripts/update_modlist.py + run: node update-modlist.js - name: Commit and push changes run: |