Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
- Change host to be case insensitive
- Fix CLI usage
  • Loading branch information
Nixinova committed Apr 3, 2021
1 parent 689ac9f commit d8886b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.1
*2021-04-04*
- Changed mod host to not be case sensitive.
- Fixed CLI usage not working.
- Fixed `setup` command not working.

## 1.0.0
*2021-04-04*
- Added functions and CLI commands `setup`, `install`, `remove`, and `update`.
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#!/usr/bin/env node

const fs = require('fs');
const download = require('download');
const curseforge = require('mc-curseforge-api');

const VERSION = '1.0.0';
const VERSION = '1.0.1';
const MODS_FILE = 'mods.json';

function getConfig() { return JSON.parse(fs.readFileSync(MODS_FILE, { encoding: 'utf8' }, data => data)); }
function getUrlFileName(url) { return url.match(/[^/]+$/)?.[0]; }

async function getMod(source, modID) {
switch (source) {
async function getMod(host, modID) {
switch (host.toLowerCase()) {
case 'curseforge': return await curseforge.getMod(+modID);
}
}

async function getModFiles(source, modID) {
switch (source) {
async function getModFiles(host, modID) {
switch (host.toLowerCase()) {
case 'curseforge': return await curseforge.getModFiles(+modID);
}
}
Expand Down Expand Up @@ -91,7 +93,7 @@ if (args[0]) {
modmanager version
Display the current version of ModManager.
`);
else if (args[0].includes('s')) init(args[1]).catch(e => console.error(e));
else if (args[0].includes('s')) setup(args[1]).catch(e => console.error(e));
else if (args[0].includes('i')) install(args[1], args[2]).catch(e => console.error(e));
else if (args[0].includes('r')) remove(args[1]).catch(e => console.error(e));
else if (args[0].includes('u')) update().catch(e => console.error(e));
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modmanager",
"version": "1.0.0",
"description": "Keep your Minecraft Forge mods up to date.",
"name": "mcmodmanager",
"version": "1.0.1",
"description": "Keep your Minecraft Forge mods up to date using a simple CLI.",
"main": "index.js",
"scripts": {
},
Expand Down
17 changes: 13 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[![Latest version](https://img.shields.io/github/v/release/Nixinova/ModManager?label=latest%20version&style=flat-square)](https://github.com/Nixinova/ModManager/releases)
[![Last updated](https://img.shields.io/github/release-date/Nixinova/ModManager?label=updated&style=flat-square)](https://github.com/Nixinova/ModManager/releases)
[![npm downloads](https://img.shields.io/npm/dt/modmanager?logo=npm)](https://www.npmjs.com/package/modmanager)
[![npm downloads](https://img.shields.io/npm/dt/mcmodmanager?logo=npm)](https://www.npmjs.com/package/mcmodmanager)

# ModManager

Keep your CurseForge Minecraft mods up to date with **ModManager**, the easy-to-use CLI command.

## Install

ModManager is available [on npm](https://npmjs.com/package/modmanage):
ModManager is available [on npm](https://npmjs.com/package/mcmodmanager):

Install it globally using `npm install -g modmanager`.
Install it globally using `npm install -g mcmodmanager`.

## Usage

Expand Down Expand Up @@ -74,4 +74,13 @@ modmanager remove 238222

### Node

ModManager has Node exports of all above CLI commands.
ModManager has Node exports of all above CLI commands:

- `setup(mcVersion)`
- Initialise a directory with a `mods.json` file and configure it to use mods for a given Minecraft version (e.g., `1.16`).
- `install(host, modID)`
- Install a mod from a given host (such as `curseforge`) from a given mod ID (e.g., `123456`).
- `remove(modID)`
- Remove a mod given an existing mod ID (e.g., `123456`).
- `update()`
- Install the latest version of all mods.

0 comments on commit d8886b9

Please sign in to comment.