refactor(installer): finish replacing sudo-prompt with electron-sudo
This commit is contained in:
Родитель
23ea0de3f1
Коммит
0a21433848
|
@ -82,7 +82,6 @@
|
|||
"pify": "^2.3.0",
|
||||
"resolve-package": "^1.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"sudo-prompt": "^6.2.1",
|
||||
"username": "^2.2.2",
|
||||
"yarn-or-npm": "^2.0.2",
|
||||
"zip-folder": "^1.0.0"
|
||||
|
|
|
@ -2,7 +2,7 @@ import fs from 'fs-promise';
|
|||
import inquirer from 'inquirer';
|
||||
import path from 'path';
|
||||
import pify from 'pify';
|
||||
import sudo from 'sudo-prompt';
|
||||
import { default as Sudoer } from 'electron-sudo';
|
||||
import { exec, spawn } from 'child_process';
|
||||
|
||||
export default async (filePath, installSpinner) => {
|
||||
|
@ -44,9 +44,8 @@ export default async (filePath, installSpinner) => {
|
|||
if (writeAccess) {
|
||||
await pify(exec)(moveCommand);
|
||||
} else {
|
||||
await pify(sudo.exec)(moveCommand, {
|
||||
name: 'Electron Forge',
|
||||
});
|
||||
const sudoer = new Sudoer({ name: 'Electron Forge' });
|
||||
await sudoer.exec(moveCommand);
|
||||
}
|
||||
|
||||
spawn('open', ['-R', targetApplicationPath], { detached: true });
|
||||
|
|
Загрузка…
Ссылка в новой задаче