christ-cli 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/install.js +4 -20
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -30,25 +30,9 @@ function getPlatform() {
30
30
  return { target, isWindows: platform === "win32" };
31
31
  }
32
32
 
33
- function getLatestVersion() {
34
- return new Promise((resolve, reject) => {
35
- https.get(
36
- `https://api.github.com/repos/${REPO}/releases/latest`,
37
- { headers: { "User-Agent": "christ-cli-npm" } },
38
- (res) => {
39
- let data = "";
40
- res.on("data", (chunk) => (data += chunk));
41
- res.on("end", () => {
42
- try {
43
- const json = JSON.parse(data);
44
- resolve(json.tag_name.replace("v", ""));
45
- } catch (e) {
46
- reject(e);
47
- }
48
- });
49
- }
50
- ).on("error", reject);
51
- });
33
+ function getVersion() {
34
+ const pkg = require(path.join(__dirname, "package.json"));
35
+ return pkg.version;
52
36
  }
53
37
 
54
38
  function download(url, dest) {
@@ -74,7 +58,7 @@ function download(url, dest) {
74
58
 
75
59
  async function main() {
76
60
  const { target, isWindows } = getPlatform();
77
- const version = await getLatestVersion();
61
+ const version = getVersion();
78
62
  const ext = isWindows ? "zip" : "tar.gz";
79
63
  const url = `https://github.com/${REPO}/releases/download/v${version}/${BINARY}-${target}.${ext}`;
80
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "christ-cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A beautiful Bible TUI for Christian developers",
5
5
  "license": "MIT",
6
6
  "repository": {