Skip to content

Commit

Permalink
Fix undefined repository owner error (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahm authored Jul 3, 2017
1 parent b82738b commit 094855a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/projects/helpers/sync.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { exec } from 'child-process-promise';
import { VError } from 'verror';
import _ from 'lodash';

import config from '../../config';
import { ProjectWorkspace } from '../models';
Expand Down Expand Up @@ -34,10 +35,11 @@ export default {
authParam = '';
}

const repoOwner = _.defaultTo(projectWorkspace.project.owner, config.defaultRepoOwner);
const cmd = `
mkdir -p ${projectWorkspace.getContractsPath()} \\
&& curl --fail --silent ${authParam} -L 'https://api.github.com/repos/${projectWorkspace
.project.owner}/${projectWorkspace.project.repo}/tarball/${projectWorkspace.rev}' \\
&& curl --fail --silent ${authParam} -L 'https://api.github.com/repos/${repoOwner}/${projectWorkspace
.project.repo}/tarball/${projectWorkspace.rev}' \\
| tar xz -C ${projectWorkspace.getPath()} --strip-components 1 --wildcards '*/${projectWorkspace
.project.dir}/' --anchored
`;
Expand Down

0 comments on commit 094855a

Please sign in to comment.