Description:
When adding an SSH key, the cli asks for the id_rsa.pub while suggesting the default location ~/.ssh/id_rsa.pub
If I press enter to use that location, or even copy/paste the exact same path (~/.ssh/id_rsa.pub
), it will fail because the script tries to read "./~/.ssh/id_rsa.pub
" which is not right.
~
should be interpreted as /home/$USER
, not as a subdir of the current directory.
The script does work if you give it the full path, ie. /home/$USER/.ssh/id_rsa.pub
Steps to Reproduce:
Example repo: N/A
ionic add ssh
Output:
$ ionic ssh add
? Enter the location to your public key file to upload to Ionic: ~/.ssh/id_rsa.pub
[ERROR] ./~/.ssh/id_rsa.pub does not appear to exist. Please specify a valid SSH public key.
My ionic info
:
$ ionic info
cli packages: (/usr/lib/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.2
Cordova Platforms : android 6.4.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Node : v9.4.0
npm : 5.6.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Other Information:
None
@Tito1337 Thanks for the bug report! I will look into this ASAP. As a workaround, please put the path on the command line like this: ionic ssh add ~/.ssh/id_rsa.pub
.
Alright, a fix for this is out (3.19.1). Thanks again!
Haha, I was surpised to see ionic-cli autoupdate so quickly.
? The Ionic CLI has an update available (3.19.0 => 3.19.1)! Would you like to install it? Yes
Thanks for the quick fix, have a great day @dwieeb