Merge branch 'ashutoshdhundhara-git-tag'

This commit is contained in:
Joao Moreno
2017-08-10 15:44:23 +02:00
5 changed files with 84 additions and 2 deletions

View File

@@ -681,6 +681,18 @@ export class Repository {
}
}
async tag(name: string, message?: string): Promise<void> {
let args = ['tag'];
if (message) {
args = [...args, '-a', name, '-m', message];
} else {
args = [...args, name];
}
await this.run(args);
}
async clean(paths: string[]): Promise<void> {
const pathsByGroup = groupBy(paths, p => path.dirname(p));
const groups = Object.keys(pathsByGroup).map(k => pathsByGroup[k]);
@@ -790,13 +802,17 @@ export class Repository {
}
}
async push(remote?: string, name?: string, setUpstream: boolean = false): Promise<void> {
async push(remote?: string, name?: string, setUpstream: boolean = false, tags = false): Promise<void> {
const args = ['push'];
if (setUpstream) {
args.push('-u');
}
if (tags) {
args.push('--tags');
}
if (remote) {
args.push(remote);
}