Skip to content

Commit 9b258e3

Browse files
committed
update binarary-install usage
1 parent 24f0c72 commit 9b258e3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tuido-npm/bin/tuido-cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
const { runBinary } = require("binary-install");
3+
const { Binary } = require("binary-install");
44
const os = require("os");
55
const path = require("path");
66

@@ -46,7 +46,9 @@ function getBinaryPath() {
4646
}
4747

4848
try {
49-
runBinary(getBinaryPath(), process.argv.slice(2));
49+
const binaryPath = getBinaryPath();
50+
const binary = new Binary("tuido", null, { installDirectory: path.dirname(binaryPath) });
51+
binary.run(process.argv.slice(2));
5052
} catch (e) {
5153
console.error("Error running tuido:", e);
5254
process.exit(1);

tuido-npm/install.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { install } = require("binary-install");
1+
const { Binary } = require("binary-install");
22
const os = require("os");
33
const { version } = require("./package.json");
44

@@ -64,7 +64,8 @@ function getBinary() {
6464
try {
6565
const { url, name } = getBinary();
6666
console.log(`Downloading tuido binary from ${url}`);
67-
install(url, name);
67+
const binary = new Binary(name, url);
68+
binary.install();
6869
} catch (e) {
6970
console.error("Error installing tuido:", e);
7071
process.exit(1);

0 commit comments

Comments
 (0)