@@ -5,6 +5,7 @@ import fs from 'fs-extra';
5
5
import CreateDialogContainer from '../containers/create-dialog-container' ;
6
6
import createRepositoryMutation from '../mutations/create-repository' ;
7
7
import { GithubLoginModelPropType } from '../prop-types' ;
8
+ import { addEvent } from '../reporter-proxy' ;
8
9
9
10
export default class CreateDialog extends React . Component {
10
11
static propTypes = {
@@ -34,6 +35,7 @@ export async function createRepository(
34
35
const result = await createRepositoryMutation ( relayEnvironment , { name, ownerID, visibility} ) ;
35
36
const sourceURL = result . createRepository . repository [ protocol === 'ssh' ? 'sshUrl' : 'url' ] ;
36
37
await clone ( sourceURL , localPath , sourceRemoteName ) ;
38
+ addEvent ( 'create-github-repository' , { package : 'github' } ) ;
37
39
}
38
40
39
41
export async function publishRepository (
@@ -65,7 +67,10 @@ export async function publishRepository(
65
67
const result = await createRepositoryMutation ( relayEnvironment , { name, ownerID, visibility} ) ;
66
68
const sourceURL = result . createRepository . repository [ protocol === 'ssh' ? 'sshUrl' : 'url' ] ;
67
69
const remote = await repository . addRemote ( sourceRemoteName , sourceURL ) ;
68
- if ( ! wasEmpty ) {
70
+ if ( wasEmpty ) {
71
+ addEvent ( 'publish-github-repository' , { package : 'github' } ) ;
72
+ } else {
69
73
await repository . push ( defaultBranchName , { remote, setUpstream : true } ) ;
74
+ addEvent ( 'init-publish-github-repository' , { package : 'github' } ) ;
70
75
}
71
76
}
0 commit comments