Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed Mar 4, 2019
1 parent 5dc9358 commit 5f8f19a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
62 changes: 62 additions & 0 deletions .ci/prepare-version.js
@@ -0,0 +1,62 @@
#!/usr/bin/env node

const fs = require("fs");
const cp = require("child_process");
const ARGUMENTS = process.argv.slice(2);

const versions = {
patch: "patch",
minor: "minor",
major: "major"
};

if (!ARGUMENTS[0]) {
console.log(
[
"esy version:prepare, prepare a new fnm version",
"",
"Usage:",
"------",
"",
" esy version:prepare patch - to prepare a patch version (X.X.X+1)",
" esy version:prepare minor - to prepare a minor version (X.X+1.0)",
" esy version:prepare major - to prepare a major version (X+1.0.0)"
].join("\n")
);
process.exit(1);
}
const versionType = versions[ARGUMENTS[0].toLowerCase()];
if (!versionType) {
throw new Error("Version (argument 0) must be one of major/minor/patch.");
}

const pkgJson = JSON.parse(fs.readFileSync("./package.json", "utf8"));
pkgJson.version = changeVersion(versionType, pkgJson.version);
fs.writeFileSync("./package.json", JSON.stringify(pkgJson, null, 2));

exec("git fetch origin");
exec("esy update-fnm-package");
exec("esy verify-fnm-package");
exec("esy build");
exec("./docs/record_screen.sh");
exec(`esy changelog`, { NEXT_VERSION: `v${pkgJson.version}` });

function exec(command, env) {
console.log(`$ ${command}`);
return cp.execSync(command, {
stdio: "inherit",
env: { ...process.env, ...env }
});
}

function changeVersion(type, version) {
const [major, minor, patch] = version.split(".").map(x => parseFloat(x, 10));
switch (type) {
case "patch":
return [major, minor, patch + 1].join(".");
case "minor":
return [major, minor + 1, 0].join(".");
case "major":
return [major + 1, 0, 0].join(".");
}
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,17 @@
## v1.6.2 (2019-03-04)

#### Bugfix 馃悰

- [#72](https://github.com/Schniz/fnm/pull/72) Fix alias paths ([@Schniz](https://github.com/Schniz))

#### Documentation 馃摑

- [#70](https://github.com/Schniz/fnm/pull/70) Fix installation script parameters docs ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.6.1 (2019-02-26)

#### Bugfix 馃悰
Expand Down
2 changes: 1 addition & 1 deletion docs/fnm.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion library/Fnm__Package.re
@@ -1 +1 @@
let version = "1.6.1";
let version = "1.6.2";
5 changes: 3 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "fnm",
"version": "1.6.1",
"version": "1.6.2",
"description": "Fast and simple Node.js version manager, built in ReasonML",
"esy": {
"build": "pesy",
Expand Down Expand Up @@ -71,7 +71,8 @@
"bootstrap": ".ci/bootstrap",
"test": "esy x TestFnm.exe",
"fmt": "bash -c 'refmt --in-place {library,executable,test}/*.re'",
"changelog": "bash -c 'esy lerna-changelog --from=v1.0.0 > CHANGELOG.md'"
"changelog": "bash -c 'esy lerna-changelog --from=v1.0.0 --next-version=${NEXT_VERSION-Unreleased} > CHANGELOG.md'",
"version:prepare": "node ./.ci/prepare-version.js"
},
"license": "GPL-3.0",
"dependencies": {
Expand Down

0 comments on commit 5f8f19a

Please sign in to comment.