|
2 | 2 | define(function (require) { |
3 | 3 |
|
4 | 4 | // Brackets modules |
5 | | - const FileSystem = brackets.getModule("filesystem/FileSystem"), |
| 5 | + const FileSystem = brackets.getModule("filesystem/FileSystem"), |
6 | 6 | FileUtils = brackets.getModule("file/FileUtils"), |
7 | 7 | ProjectManager = brackets.getModule("project/ProjectManager"), |
8 | 8 | CommandManager = brackets.getModule("command/CommandManager"), |
9 | | - StringUtils = brackets.getModule("utils/StringUtils"); |
| 9 | + Metrics = brackets.getModule("utils/Metrics"), |
| 10 | + Strings = brackets.getModule("strings"), |
| 11 | + StringUtils = brackets.getModule("utils/StringUtils"); |
10 | 12 |
|
11 | 13 | // Local modules |
12 | | - const ErrorHandler = require("src/ErrorHandler"), |
| 14 | + const ErrorHandler = require("src/ErrorHandler"), |
13 | 15 | Events = require("src/Events"), |
14 | 16 | EventEmitter = require("src/EventEmitter"), |
15 | | - Strings = brackets.getModule("strings"), |
16 | 17 | ExpectedError = require("src/ExpectedError"), |
17 | 18 | ProgressDialog = require("src/dialogs/Progress"), |
18 | 19 | CloneDialog = require("src/dialogs/Clone"), |
@@ -73,8 +74,10 @@ define(function (require) { |
73 | 74 | return stageGitIgnore("Initial staging"); |
74 | 75 | }).catch(function (err) { |
75 | 76 | ErrorHandler.showError(err, Strings.INIT_NEW_REPO_FAILED, true); |
| 77 | + Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'init', "fail"); |
76 | 78 | }).then(function () { |
77 | 79 | EventEmitter.emit(Events.REFRESH_ALL); |
| 80 | + Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'init', "success"); |
78 | 81 | }); |
79 | 82 | } |
80 | 83 |
|
@@ -140,8 +143,11 @@ define(function (require) { |
140 | 143 | // when dialog is cancelled, there's no error |
141 | 144 | if (err) { ErrorHandler.showError(err, Strings.GIT_CLONE_REMOTE_FAILED); } |
142 | 145 | }); |
| 146 | + }).then(()=>{ |
| 147 | + Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'clone', "success"); |
143 | 148 | }).catch(function (err) { |
144 | 149 | ErrorHandler.showError(err); |
| 150 | + Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'clone', "fail"); |
145 | 151 | }).finally(function () { |
146 | 152 | $cloneButton.prop("disabled", false); |
147 | 153 | }); |
|
0 commit comments