(withNotification: boolean)
| 127 | }; |
| 128 | |
| 129 | export const installCLI = async (withNotification: boolean) => { |
| 130 | if (process.platform === 'win32') { |
| 131 | try { |
| 132 | await addBinToUserPath(); |
| 133 | logNotify( |
| 134 | withNotification, |
| 135 | 'Hyper CLI installed', |
| 136 | 'You may need to restart your computer to complete this installation process.' |
| 137 | ); |
| 138 | } catch (err) { |
| 139 | logNotify(withNotification, 'Hyper CLI installation failed', `Failed to add Hyper CLI path to user PATH ${err}`); |
| 140 | } |
| 141 | } else if (process.platform === 'darwin' || process.platform === 'linux') { |
| 142 | // AppImages are mounted on run at a temporary path, don't create symlink |
| 143 | if (process.env['APPIMAGE']) { |
| 144 | console.log('Skipping CLI symlink creation as it is an AppImage install'); |
| 145 | return; |
| 146 | } |
| 147 | try { |
| 148 | await addSymlink(!withNotification); |
| 149 | logNotify(withNotification, 'Hyper CLI installed', `Symlink created at ${cliLinkPath}`); |
| 150 | } catch (error) { |
| 151 | logNotify(withNotification, 'Hyper CLI installation failed', `${error}`); |
| 152 | } |
| 153 | } else { |
| 154 | logNotify(withNotification, 'Hyper CLI installation failed', `Unsupported platform ${process.platform}`); |
| 155 | } |
| 156 | }; |
no test coverage detected