Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a395ddd

Browse files
Merge branch 'master' into features/metrics-repo-size
2 parents fc7212d + d954f0f commit a395ddd

File tree

21 files changed

+245
-157
lines changed

21 files changed

+245
-157
lines changed

common/SolutionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ internal static class AssemblyVersionInformation {
3434
// this is for the AssemblyVersion and AssemblyVersion attributes, which can't handle alphanumerics
3535
internal const string VersionForAssembly = "1.0.0";
3636
// Actual real version
37-
internal const string Version = "1.0.0rc2";
37+
internal const string Version = "1.0.0rc3";
3838
}
3939
}

octorun/src/bin/app-usage.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var commander = require("commander");
22
var package = require('../../package.json')
3+
var config = require("../configuration");
34
var endOfLine = require('os').EOL;
45
var fs = require('fs');
56
var util = require('util');
@@ -45,6 +46,9 @@ if (fileContents && host) {
4546
'Content-Type': 'application/json'
4647
}
4748
};
49+
if (config.token) {
50+
options.headers['Authorization'] = 'token ' + config.token;
51+
}
4852

4953
var req = https.request(options, function (res) {
5054
var success = res.statusCode == 200;

octorun/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9fcd9faa
1+
b4b80eb4ac

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ protected void Initialize()
4747
ApplicationConfiguration.WebTimeout = UserSettings.Get(Constants.WebTimeoutKey, ApplicationConfiguration.WebTimeout);
4848
Platform.Initialize(ProcessManager, TaskManager);
4949
progress.OnProgress += progressReporter.UpdateProgress;
50+
UsageTracker = new UsageTracker(UserSettings, Environment, InstanceId.ToString());
51+
52+
#if ENABLE_METRICS
53+
var metricsService = new MetricsService(ProcessManager,
54+
TaskManager,
55+
Environment.FileSystem,
56+
Environment.NodeJsExecutablePath,
57+
Environment.OctorunScriptPath);
58+
UsageTracker.MetricsService = metricsService;
59+
#endif
5060
}
5161

5262
public void Run()
@@ -59,8 +69,7 @@ public void Run()
5969
GitInstallationState state = new GitInstallationState();
6070
try
6171
{
62-
SetupMetrics(Environment.UnityVersion);
63-
72+
SetupMetrics();
6473
if (Environment.IsMac)
6574
{
6675
var getEnvPath = new SimpleProcessTask(TaskManager.Token, "bash".ToNPath(), "-c \"/usr/libexec/path_helper\"")
@@ -333,35 +342,14 @@ public void RestartRepository()
333342
Logger.Trace($"Got a repository? {(Environment.Repository != null ? Environment.Repository.LocalPath : "null")}");
334343
}
335344

336-
protected void SetupMetrics(string unityVersion)
345+
protected void SetupMetrics()
337346
{
338-
string userId = null;
339-
if (UserSettings.Exists(Constants.GuidKey))
340-
{
341-
userId = UserSettings.Get(Constants.GuidKey);
342-
}
343-
344-
if (String.IsNullOrEmpty(userId))
345-
{
346-
userId = Guid.NewGuid().ToString();
347-
UserSettings.Set(Constants.GuidKey, userId);
348-
}
349-
350-
#if ENABLE_METRICS
351-
var metricsService = new MetricsService(ProcessManager,
352-
TaskManager,
353-
Environment.FileSystem,
354-
Environment.NodeJsExecutablePath,
355-
Environment.OctorunScriptPath);
356-
357-
UsageTracker = new UsageTracker(metricsService, UserSettings, Environment, userId, unityVersion, InstanceId.ToString());
358-
359347
if (firstRun)
360348
{
361349
UsageTracker.IncrementNumberOfStartups();
362350
}
363-
#endif
364351
}
352+
365353
protected abstract void InitializeUI();
366354
protected abstract void InitializationComplete();
367355

src/GitHub.Api/IO/NiceIO.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -688,20 +688,27 @@ public void Delete(DeleteMode deleteMode = DeleteMode.Normal)
688688
if (IsRoot)
689689
throw new NotSupportedException("Delete is not supported on a root level directory because it would be dangerous:" + ToString());
690690

691-
if (FileExists())
692-
FileSystem.FileDelete(ToString());
693-
else if (DirectoryExists())
694-
try
691+
var isFile = FileExists();
692+
var isDir = DirectoryExists();
693+
if (!isFile && !isDir)
694+
throw new InvalidOperationException("Trying to delete a path that does not exist: " + ToString());
695+
696+
try
697+
{
698+
if (isFile)
695699
{
696-
FileSystem.DirectoryDelete(ToString(), true);
700+
FileSystem.FileDelete(ToString());
697701
}
698-
catch (IOException)
702+
else
699703
{
700-
if (deleteMode == DeleteMode.Normal)
701-
throw;
704+
FileSystem.DirectoryDelete(ToString(), true);
702705
}
703-
else
704-
throw new InvalidOperationException("Trying to delete a path that does not exist: " + ToString());
706+
}
707+
catch (IOException)
708+
{
709+
if (deleteMode == DeleteMode.Normal)
710+
throw;
711+
}
705712
}
706713

707714
public void DeleteIfExists(DeleteMode deleteMode = DeleteMode.Normal)

src/GitHub.Api/Installer/OctorunInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class OctorunInstallDetails
8585
public const string DefaultZipMd5Url = "http://github-vs.s3.amazonaws.com/unity/octorun/octorun.zip.md5";
8686
public const string DefaultZipUrl = "http://github-vs.s3.amazonaws.com/unity/octorun/octorun.zip";
8787

88-
public const string PackageVersion = "9fcd9faa";
88+
public const string PackageVersion = "b4b80eb4ac";
8989
private const string PackageName = "octorun";
9090
private const string zipFile = "octorun.zip";
9191

src/GitHub.Api/Localization.Designer.cs

Lines changed: 46 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)