Skip to content

Commit

Permalink
fix: Use abs path to id_rsa
Browse files Browse the repository at this point in the history
  • Loading branch information
finom committed May 31, 2017
1 parent 7d3e9b6 commit 8273c7d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const os = require('os');

const run = require('./run');

const dir = `${os.homedir()}/.mongo-git-backup`;
const homedir = os.homedir();
const dir = `${homedir}/.mongo-git-backup`;

async function pureExport({
host = 'localhost',
Expand Down Expand Up @@ -45,8 +46,10 @@ async function pureExport({
try {
// Travis CI and maybe other environments require this step
await run(`eval \`ssh-agent -s\` &&
ssh-add ~/.ssh/id_rsa`);
} catch (e) {} // eslint-disable-line no-empty
ssh-add ${homedir}/.ssh/id_rsa`);
} catch (e) {
console.log(chalk.yellow(e));
}

console.log(await run(`
git clone -b ${branch} ${repo} ${tmpDir} &&
Expand Down

0 comments on commit 8273c7d

Please sign in to comment.