teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

Suggestion: automatically look in user directory for private key? #47

Closed nickautomatic closed 8 years ago

nickautomatic commented 8 years ago

Hi. Just a quick suggestion. Your current README shows a hard-coded path to the user directory, but I need to write a Gulpfile that will work regardless of user or machine, so I can't hard-code that. After a bit of trial and error, I found you can use Node's os.homedir() to avoid hard-coding the path. I wonder if this (below) might be a better starting point for the README? (Or even a default place to look if no privateKey was specified...)

privateKey: fs.readFileSync(require('os').homedir() + '/.ssh/id_rsa')

Thanks!