Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
68a0c0e35b
|
|||
| 8cc93d55da | |||
|
dd4ca1f1cc
|
|||
| 7264816e01 |
@@ -1,7 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
Generation of this changelog is based on commits
|
Generation of this changelog is based on commits
|
||||||
|
## v1.12.2
|
||||||
|
### Fixes
|
||||||
|
- [8cc93d55d] - use http module instead of fetch (#17)
|
||||||
|
## v1.12.1
|
||||||
|
### Miscellaneous
|
||||||
|
- [dd4ca1f1c] - **release**: v1.12.1
|
||||||
|
- [7264816e0] - change installation instructions
|
||||||
## v1.12.0
|
## v1.12.0
|
||||||
### Miscellaneous
|
### Miscellaneous
|
||||||
|
- [2a5dba1aa] - **release**: v1.12.0
|
||||||
- [72ab0c848] - add license
|
- [72ab0c848] - add license
|
||||||
- [afc4f76c4] - foramt the code with prettier
|
- [afc4f76c4] - foramt the code with prettier
|
||||||
## v1.11.0
|
## v1.11.0
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Resultium commit standardization library
|
|||||||
|
|
||||||
1. Set up @resultium registry in an .npmrc file in your home directory with following content:
|
1. Set up @resultium registry in an .npmrc file in your home directory with following content:
|
||||||
```
|
```
|
||||||
@resultium:registry=https://git.resultium.net/api/packages/technology/npm/
|
@resultium:registry=https://git.resultium.net/api/packages/public/npm/
|
||||||
```
|
```
|
||||||
2. Install the package using npm
|
2. Install the package using npm
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@resultium/rcz",
|
"name": "@resultium/rcz",
|
||||||
"version": "1.12.0",
|
"version": "1.12.2",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"description": "Resultium commit standardization library, inspired by conventional commits",
|
"description": "Resultium commit standardization library, inspired by conventional commits",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
21
src/index.ts
21
src/index.ts
@@ -37,6 +37,7 @@ import { Command } from "commander";
|
|||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { tmpdir } from "os";
|
import { tmpdir } from "os";
|
||||||
|
import { request } from "http";
|
||||||
|
|
||||||
const GetConfig = async () => {
|
const GetConfig = async () => {
|
||||||
if (fs.existsSync(path.join(process.cwd(), ".rczrc"))) {
|
if (fs.existsSync(path.join(process.cwd(), ".rczrc"))) {
|
||||||
@@ -105,6 +106,21 @@ const GetPostReleaseScript = async () => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const isOnline = () => {
|
||||||
|
return new Promise<boolean>((resolve) => {
|
||||||
|
request({ method: "GET", hostname: "icanhazip.com" }, (res) => {
|
||||||
|
res.on("data", () => {});
|
||||||
|
|
||||||
|
res.on("end", () => {
|
||||||
|
resolve(res.statusCode === 200);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.on("error", () => {
|
||||||
|
resolve(false);
|
||||||
|
})
|
||||||
|
.end();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const CheckForUpdates = async () => {
|
const CheckForUpdates = async () => {
|
||||||
const updateText =
|
const updateText =
|
||||||
@@ -119,8 +135,7 @@ const CheckForUpdates = async () => {
|
|||||||
|
|
||||||
// even if cached once in a while it should get newest data
|
// even if cached once in a while it should get newest data
|
||||||
if ((cachedVersion && Math.random() < 0.1) || cachedVersion === null) {
|
if ((cachedVersion && Math.random() < 0.1) || cachedVersion === null) {
|
||||||
const isOnline = (await fetch("https://icanhazip.com")).status === 200;
|
if (!(await isOnline())) return;
|
||||||
if (!isOnline) return;
|
|
||||||
|
|
||||||
const serverVersion = execSync("npm show @resultium/rcz version")
|
const serverVersion = execSync("npm show @resultium/rcz version")
|
||||||
.toString()
|
.toString()
|
||||||
@@ -142,7 +157,7 @@ const program = new Command();
|
|||||||
program
|
program
|
||||||
.name("rcz")
|
.name("rcz")
|
||||||
.description("Resultium commit standardization command-line interface")
|
.description("Resultium commit standardization command-line interface")
|
||||||
.version("1.12.0");
|
.version("1.12.2");
|
||||||
|
|
||||||
program
|
program
|
||||||
.command("commit")
|
.command("commit")
|
||||||
|
|||||||
Reference in New Issue
Block a user