fix(core): update
This commit is contained in:
parent
8616613a95
commit
46fce49356
@ -1,4 +1,12 @@
|
|||||||
import { tap, expect } from '@pushrocks/tapbundle';
|
import { tap, expect } from '@pushrocks/tapbundle';
|
||||||
import * as smartgit from '../ts/index';
|
import * as smartgit from '../ts/index';
|
||||||
|
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
const testRepoDir = path.join(__dirname, '../.nogit/testrepo');
|
||||||
|
|
||||||
|
tap.test('should create a new repo at .nogit', async () => {
|
||||||
|
const gitRepo = await smartgit.GitRepo.fromCreatingRepoInDir(testRepoDir);
|
||||||
|
})
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -8,7 +8,7 @@ export class GitRepo {
|
|||||||
/**
|
/**
|
||||||
* creates a new GitRepo Instance after cloning a project
|
* creates a new GitRepo Instance after cloning a project
|
||||||
*/
|
*/
|
||||||
public static async createRepoFromClone(fromArg: string, toArg: string): Promise<GitRepo> {
|
public static async fromCloningIntoDir(fromArg: string, toArg: string): Promise<GitRepo> {
|
||||||
const dirArg = plugins.path.resolve(toArg);
|
const dirArg = plugins.path.resolve(toArg);
|
||||||
const ngRespository = await plugins.nodegit.Clone.clone(fromArg, toArg, {
|
const ngRespository = await plugins.nodegit.Clone.clone(fromArg, toArg, {
|
||||||
bare: 0,
|
bare: 0,
|
||||||
@ -17,13 +17,13 @@ export class GitRepo {
|
|||||||
return new GitRepo(ngRespository);
|
return new GitRepo(ngRespository);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async createNewRepoInDir(dirArg: string): Promise<GitRepo> {
|
public static async fromCreatingRepoInDir(dirArg: string): Promise<GitRepo> {
|
||||||
dirArg = plugins.path.resolve(dirArg);
|
dirArg = plugins.path.resolve(dirArg);
|
||||||
const ngRepository = await plugins.nodegit.Repository.init(dirArg, 0);
|
const ngRepository = await plugins.nodegit.Repository.init(dirArg, 0);
|
||||||
return new GitRepo(ngRepository);
|
return new GitRepo(ngRepository);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async openRepoAt(dirArg: string) {
|
public static async fromOpeningRepoDir(dirArg: string) {
|
||||||
dirArg = plugins.path.resolve(dirArg);
|
dirArg = plugins.path.resolve(dirArg);
|
||||||
const ngRepository = await plugins.nodegit.Repository.open(dirArg);
|
const ngRepository = await plugins.nodegit.Repository.open(dirArg);
|
||||||
return new GitRepo(ngRepository);
|
return new GitRepo(ngRepository);
|
||||||
|
@ -11,6 +11,6 @@ import * as smartstring from '@pushrocks/smartstring';
|
|||||||
export { smartfile, smartpath, smartpromise, smartstring };
|
export { smartfile, smartpath, smartpromise, smartstring };
|
||||||
|
|
||||||
// third party
|
// third party
|
||||||
import * as nodegit from 'nodegit';
|
import nodegit from 'nodegit';
|
||||||
|
|
||||||
export { nodegit };
|
export { nodegit };
|
||||||
|
Loading…
Reference in New Issue
Block a user