Skip to content

Commit

Permalink
fix: spin (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
elrrrrrrr authored Nov 8, 2023
1 parent d4faa63 commit b1276f8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/cli/lib/fuse_t.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const urllib = require('urllib');
const execa = require('execa');
const os = require('node:os');
const inquirer = require('inquirer');
const { Spin } = require('./logger');


const FUSE_T_INSTALL_PATH = '/usr/local/bin/go-nfsv4';
Expand All @@ -25,18 +24,13 @@ exports.checkFuseT = async function checkFuseT() {
};

exports.installFuseT = async function installFuseT() {
const spin = new Spin({
title: 'Installing fuse-t, it may take a few seconds',
showDots: true,
});
const tmpPath = path.join('/tmp', `${crypto.randomUUID()}.pkg`);
await urllib.request(FUSE_T_DOWNLOAD_URL, {
method: 'GET',
writeStream: fsSync.createWriteStream(tmpPath),
followRedirect: true,
});
await execa.command(`sudo installer -pkg ${tmpPath} -target /`);
spin.success('fuse-t installed successfully');
};

exports.confirmInstallFuseT = async function confirmInstallFuseT() {
Expand All @@ -45,7 +39,7 @@ exports.confirmInstallFuseT = async function confirmInstallFuseT() {
const answers = await inquirer.prompt([{
type: 'confirm',
name: 'installFuseT',
message: 'Do you want install fuse-t?',
message: 'Do you want install fuse-t? It may take a few seconds',
default: true,
}]);
return answers.installFuseT === true;
Expand Down

0 comments on commit b1276f8

Please sign in to comment.