fix ssh url handling
This commit is contained in:
parent
32447ade1b
commit
32eeb6d0cf
6 changed files with 8 additions and 12 deletions
|
|
@ -292,12 +292,11 @@ export function leaveFullScreen(): HyperActions {
|
|||
};
|
||||
}
|
||||
|
||||
export function openSSH(url: string) {
|
||||
export function openSSH(parsedUrl: ReturnType<typeof parseUrl>) {
|
||||
return (dispatch: HyperDispatch) => {
|
||||
dispatch({
|
||||
type: UI_OPEN_SSH_URL,
|
||||
effect() {
|
||||
const parsedUrl = parseUrl(url, true);
|
||||
let command = `${parsedUrl.protocol} ${parsedUrl.user ? `${parsedUrl.user}@` : ''}${parsedUrl.resource}`;
|
||||
|
||||
if (parsedUrl.port) command += ` -p ${parsedUrl.port}`;
|
||||
|
|
|
|||
4
lib/ext-modules.d.ts
vendored
4
lib/ext-modules.d.ts
vendored
|
|
@ -2,10 +2,6 @@ declare module 'php-escape-shell' {
|
|||
export function php_escapeshellcmd(path: string): string;
|
||||
}
|
||||
|
||||
declare module 'parse-url' {
|
||||
export default function (...args: any[]): any;
|
||||
}
|
||||
|
||||
declare module 'react-deep-force-update' {
|
||||
export default function (...args: any[]): any;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,8 +204,8 @@ rpc.on('open file', ({path}) => {
|
|||
store_.dispatch(uiActions.openFile(path));
|
||||
});
|
||||
|
||||
rpc.on('open ssh', (url) => {
|
||||
store_.dispatch(uiActions.openSSH(url));
|
||||
rpc.on('open ssh', (parsedUrl) => {
|
||||
store_.dispatch(uiActions.openSSH(parsedUrl));
|
||||
});
|
||||
|
||||
rpc.on('update available', ({releaseName, releaseNotes, releaseUrl, canInstall}) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue