fix(core): update

This commit is contained in:
2022-07-31 15:18:04 +02:00
parent b46d1e19a7
commit f5617d9d45
9 changed files with 42 additions and 65 deletions

View File

@@ -8,31 +8,33 @@ export class Smartgit {
http: any;
} = {
fs: null,
http: null
}
http: null,
};
constructor() {};
constructor() {}
public async init() {
if (this.smartenvInstance.isNode) {
this.envDeps.fs = await this.smartenvInstance.getSafeNodeModule('fs');
this.envDeps.http = await this.smartenvInstance.getSafeNodeModule('isomorphic-git/http/node/index.js');
this.envDeps.http = await this.smartenvInstance.getSafeNodeModule(
'isomorphic-git/http/node/index.js'
);
} else {
throw new Error('currently only node.js is supported.')
throw new Error('currently only node.js is supported.');
}
};
}
public async createRepoByClone(fromUrlArg: string, toDirArg: string) {
const repo = await GitRepo.fromCloningIntoDir(this, fromUrlArg, toDirArg)
};
const repo = await GitRepo.fromCloningIntoDir(this, fromUrlArg, toDirArg);
}
public async createRepoByInit(dirArg: string) {
const repo = await GitRepo.fromCreatingRepoInDir(this, dirArg);
return repo;
};
}
public async createRepoByOpen(dirArg: string) {
const repo = await GitRepo.fromOpeningRepoDir(this, dirArg);
return repo;
}
}
}