Skip to content

Commit

Permalink
feat: added a link to the version-accurate help page
Browse files Browse the repository at this point in the history
  • Loading branch information
meza committed Oct 25, 2022
1 parent 2ad0670 commit d68dcc2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:

- name: 🚀 Build & Release
env:
HELP_URL: ${{github.server_url}}/${{github.repository}}/blob/${{github.sha}}/README.md
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
FILE=$1
VERSION=$2

echo "HELP URL: $HELP_URL"

cat > "$FILE" <<EOF
export const version = '$VERSION';
EOF

sed -i "s/\"version\": \"[0-9.]*\"/\"version\": \"$VERSION\"/" package.json
sed -i "s|REPL_CURSEFORGE_API_KEY|$CURSEFORGE_API_KEY|" src/env.ts
sed -i "s|REPL_MODRINTH_API_KEY|$MODRINTH_API_KEY|" src/env.ts
sed -i "s|REPL_HELP_URL|$HELP_URL|" src/env.ts

echo "Set version to $VERSION"
3 changes: 2 additions & 1 deletion src/__snapshots__/mmm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Command {
"_description": "Manages mods from Modrinth and Curseforge",
"_enablePositionalOptions": false,
"_events": {
"afterHelp": [Function],
"option:config": [Function],
"option:debug": [
[Function],
Expand All @@ -25,7 +26,7 @@ Command {
],
"option:version": [Function],
},
"_eventsCount": 4,
"_eventsCount": 5,
"_executableDir": null,
"_executableFile": null,
"_executableHandler": false,
Expand Down
1 change: 1 addition & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const curseForgeApiKey = process.env.CURSEFORGE_API_KEY || 'REPL_CURSEFORGE_API_KEY';
export const modrinthApiKey = process.env.MODRINTH_API_KEY || 'REPL_MODRINTH_API_KEY';
export const helpUrl = process.env.HELP_URL || 'REPL_HELP_URL';
2 changes: 2 additions & 0 deletions src/mmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { version } from './version.js';
import { update } from './actions/update.js';
import { initializeConfig } from './interactions/initializeConfig.js';
import { Logger } from './lib/Logger.js';
import { helpUrl } from './env.js';

export const APP_NAME = 'Minecraft Mod Manager';
export const APP_DESCRIPTION = 'Manages mods from Modrinth and Curseforge';
Expand All @@ -33,6 +34,7 @@ export const stop = (): never => {
const commands = [];

program.name(APP_NAME).version(version).description(APP_DESCRIPTION);
program.addHelpText('after', '\nFor more information, visit: ' + helpUrl);

program.on('option:quiet', () => {
logger.flagQuiet();
Expand Down

0 comments on commit d68dcc2

Please sign in to comment.