mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
create /usr/local/bin if it doesn't exist
This commit is contained in:
parent
ff40cdb578
commit
812ca44ffb
1 changed files with 8 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import {Registry, loadRegistry} from './registry';
|
||||||
import type {ValueType} from 'native-reg';
|
import type {ValueType} from 'native-reg';
|
||||||
import sudoPrompt from 'sudo-prompt';
|
import sudoPrompt from 'sudo-prompt';
|
||||||
import {clipboard, dialog} from 'electron';
|
import {clipboard, dialog} from 'electron';
|
||||||
|
import {mkdirpSync} from 'fs-extra';
|
||||||
|
|
||||||
const readlink = pify(fs.readlink);
|
const readlink = pify(fs.readlink);
|
||||||
const symlink = pify(fs.symlink);
|
const symlink = pify(fs.symlink);
|
||||||
|
|
@ -31,6 +32,13 @@ const addSymlink = async (silent: boolean) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('Linking HyperCLI');
|
console.log('Linking HyperCLI');
|
||||||
|
if (!fs.existsSync(path.dirname(cliLinkPath))) {
|
||||||
|
try {
|
||||||
|
mkdirpSync(path.dirname(cliLinkPath));
|
||||||
|
} catch (err) {
|
||||||
|
throw `Failed to create directory ${path.dirname(cliLinkPath)} - ${err}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
await symlink(cliScriptPath, cliLinkPath);
|
await symlink(cliScriptPath, cliLinkPath);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 'EINVAL' is returned by readlink,
|
// 'EINVAL' is returned by readlink,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue