Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
- Fixed overflow into dependencies
- Fixed a crash
  • Loading branch information
Nixinova committed Jan 23, 2021
1 parent 8a49292 commit a67810a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.2
*2021-01-23*
- Fixed the command-line tool overflowing into dependencies.
- Fixed a crash occurring when using `pack-format --version`.

## 1.0.1
*2021-01-23*
- Fixed command-line usage not working.
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env node
const VERSION = '1.0.2'

class Snapshot {
constructor(version) { this.version = version }
getYear() { return parseInt(this.version.replace(/^(\d\d).+$/, '$1')) }
Expand All @@ -8,7 +10,7 @@ class Snapshot {

function getPackFormat(version) {
if (!version) return
version = version.toString();
version = version.toString()

// Snapshot //

Expand Down Expand Up @@ -63,7 +65,7 @@ function getPackFormat(version) {
module.exports = getPackFormat

const arg = n => process.argv[n + 1]
if (arg(1)) {
if (arg(1) && arg(0).includes('pack-format')) {
if (arg(1).includes('-v')) console.log('The current version of pack-format is ' + VERSION)
else console.log('Pack format of ' + arg(1) + ' is ' + getPackFormat(arg(1)))
}
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.0.1",
"version": "1.0.2",
"description": "Returns the pack_format of any Minecraft version, including snapshots",
"scripts": {
"test": "node test"
Expand Down

0 comments on commit a67810a

Please sign in to comment.