-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from CaseyHaralson/git-backend
adding ability to use local git install to clone repos
- Loading branch information
Showing
5 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import GitlyOptions from '../interfaces/options' | ||
import parse from './parse' | ||
import spawn from 'cross-spawn' | ||
|
||
/** | ||
* Uses local git installation to clone a repository to the destination. | ||
*/ | ||
export default async function gitClone( | ||
repository: string, | ||
destination: string, | ||
options: GitlyOptions = {} | ||
): Promise<[string, string]> { | ||
const info = parse(repository, options) | ||
spawn.sync('git', ['clone', info.href, destination]) | ||
return [info.href, destination] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters