Skip to content

Commit

Permalink
1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Nov 3, 2024
1 parent 181d2df commit 0200d49
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 44 deletions.
6 changes: 3 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## Next
## 1.4.0
- Added `release` and `snapshot` to exported object `LATEST` which denotes the latest known released versions.
- Added basic message when no arguments are given.
- Changed output of `getVersions` to return `null` instead of `''` when a version is not present.
- Changed output of `getVersions` to replace '`.x`' with the actual game version.
- Changed CLI output of `--list` to present the versions in prose instead of JSON.
- Changed help message.
- Changed CLI output to display a basic message when no arguments are given.
- Changed CLI help message.

## 1.3.16
- Updated resource pack format to `36`.
Expand Down
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ISC License

Copyright © Nixinova 2021–2022
Copyright © Nixinova 2021–2024

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
46 changes: 13 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pack-format",
"version": "1.3.16",
"version": "1.4.0",
"description": "Returns the pack_format of any Minecraft version, including snapshots",
"scripts": {
"prepublish": "tsc",
Expand Down
16 changes: 10 additions & 6 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import { getPackFormat, getPackFormats, getVersions, LATEST } from './index'
import { FormatResult } from './types'
const VERSION = require('../package.json').version

const indent = (n: number): string => ' '.repeat(n * 4)
const indent = (n: number): string => ' '.repeat(n * 2)
const log = function ([argFull, argShort]: string[], desc: string[], example: string): void {
console.log('\n')
console.log(`${indent(1)}${argFull}`)
console.log()
console.log(`${indent(2)}${argFull}`)
if (argShort)
console.log(`${indent(1)}${argShort}`)
console.log(`${indent(2)}${argShort}`)
console.log()
for (let i in desc)
console.log(indent(2) + desc[i])
console.log(`${indent(3)}Example: ${example}`)
console.log(indent(2) + indent(2) + desc[i])
console.log(indent(2) + indent(3) + 'Example: ' + example)
console.log()
}

const rawArgs = process.argv.slice(2)
Expand All @@ -27,6 +29,8 @@ const ver = args._[0]

// Print the help message
if (args.help) {
console.log()
console.log(`\n${indent(1)}pack-format\n`)
log(
[
'<version>',
Expand Down

0 comments on commit 0200d49

Please sign in to comment.