Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
fix npm installer, update package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Aug 31, 2022
1 parent 94a81dd commit 88fb1dd
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 180 deletions.
6 changes: 3 additions & 3 deletions npm-installer/postinstall.js → install.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from "fs/promises";
import fetch from "node-fetch";
import { pipeline } from "stream/promises";
import StreamZip from "node-stream-zip";
import { ARCH_MAPPING, CONFIG, PLATFORM_MAPPING } from "./config.js";
import { ARCH_MAPPING, CONFIG, PLATFORM_MAPPING } from "./npm-config.js";
import path from "path";

async function install() {
Expand Down Expand Up @@ -38,7 +38,7 @@ async function install() {
if (old == "yes") {
return path.join(f, "bin", "botway");
} else if (old == "no") {
return path.join("..", "bin", "botway");
return path.join("bin", "botway");
} else {
return f;
}
Expand Down Expand Up @@ -66,7 +66,7 @@ async function install() {
});

// chmod +x /bin/botway
await fs.chmod(path.join("..", "bin", "botway"), 0o755);
await fs.chmod(path.join("bin", "botway"), 0o755);

await fs.rm(zipFile);
await fs.rm(folder(), { recursive: true });
Expand Down
2 changes: 1 addition & 1 deletion npm-installer/config.js → npm-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const CONFIG = {
/**
* @type {string}
*/
path: "./bin",
path: "../bin",

/**
* @type {string}
Expand Down
Binary file removed npm-installer/bun.lockb
Binary file not shown.
34 changes: 0 additions & 34 deletions npm-installer/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"node": ">=8.0.0"
},
"bin": {
"botway": "../bin/botway.js"
"botway": "bin/botway.js"
},
"scripts": {
"postinstall": "node ./postinstall.js"
"postinstall": "node ./install.js"
},
"files": [
"../bin",
"bin",
"config.js",
"postinstall.js"
"install.js"
],
"dependencies": {
"global": "^4.4.0",
Expand Down
Loading

0 comments on commit 88fb1dd

Please sign in to comment.