|
5 | 5 |
|
6 | 6 | namespace GitHub.Unity
|
7 | 7 | {
|
8 |
| - class GitInstallDetails |
9 |
| - { |
10 |
| - public const string DefaultGitZipMd5Url = "https://ghfvs-installer.github.com/unity/portable_git/git.zip.MD5.txt"; |
11 |
| - public const string DefaultGitZipUrl = "https://ghfvs-installer.github.com/unity/portable_git/git.zip"; |
12 |
| - public const string DefaultGitLfsZipMd5Url = "https://ghfvs-installer.github.com/unity/portable_git/git-lfs.zip.MD5.txt"; |
13 |
| - public const string DefaultGitLfsZipUrl = "https://ghfvs-installer.github.com/unity/portable_git/git-lfs.zip"; |
14 |
| - |
15 |
| - public const string GitExtractedMD5 = "e6cfc0c294a2312042f27f893dfc9c0a"; |
16 |
| - public const string GitLfsExtractedMD5 = "36e3ae968b69fbf42dff72311040d24a"; |
17 |
| - |
18 |
| - public const string WindowsGitExecutableMD5 = "50570ed932559f294d1a1361801740b9"; |
19 |
| - public const string MacGitExecutableMD5 = ""; |
20 |
| - |
21 |
| - public const string WindowsGitLfsExecutableMD5 = "177bb14d0c08f665a24f0d5516c3b080"; |
22 |
| - public const string MacGitLfsExecutableMD5 = "f81a1a065a26a4123193e8fd96c561ad"; |
23 |
| - |
24 |
| - private const string PackageVersion = "f02737a78695063deace08e96d5042710d3e32db"; |
25 |
| - private const string PackageName = "PortableGit"; |
26 |
| - |
27 |
| - private readonly bool onWindows; |
28 |
| - |
29 |
| - public GitInstallDetails(NPath baseDataPath, bool onWindows) |
30 |
| - { |
31 |
| - this.onWindows = onWindows; |
32 |
| - |
33 |
| - ZipPath = baseDataPath.Combine("downloads"); |
34 |
| - ZipPath.EnsureDirectoryExists(); |
35 |
| - |
36 |
| - var gitInstallPath = baseDataPath.Combine(PackageNameWithVersion); |
37 |
| - GitInstallationPath = gitInstallPath; |
38 |
| - |
39 |
| - if (onWindows) |
40 |
| - { |
41 |
| - GitExecutable += "git.exe"; |
42 |
| - GitLfsExecutable += "git-lfs.exe"; |
43 |
| - |
44 |
| - GitExecutablePath = gitInstallPath.Combine("cmd", GitExecutable); |
45 |
| - } |
46 |
| - else |
47 |
| - { |
48 |
| - GitExecutable = "git"; |
49 |
| - GitLfsExecutable = "git-lfs"; |
50 |
| - |
51 |
| - GitExecutablePath = gitInstallPath.Combine("bin", GitExecutable); |
52 |
| - } |
53 |
| - |
54 |
| - GitLfsExecutablePath = GetGitLfsExecutablePath(gitInstallPath); |
55 |
| - } |
56 |
| - |
57 |
| - public NPath GetGitLfsExecutablePath(NPath gitInstallRoot) |
58 |
| - { |
59 |
| - return onWindows |
60 |
| - ? gitInstallRoot.Combine("mingw32", "libexec", "git-core", GitLfsExecutable) |
61 |
| - : gitInstallRoot.Combine("libexec", "git-core", GitLfsExecutable); |
62 |
| - } |
63 |
| - |
64 |
| - public NPath ZipPath { get; } |
65 |
| - public NPath GitInstallationPath { get; } |
66 |
| - public string GitExecutable { get; } |
67 |
| - public NPath GitExecutablePath { get; } |
68 |
| - public string GitLfsExecutable { get; } |
69 |
| - public NPath GitLfsExecutablePath { get; } |
70 |
| - public UriString GitZipMd5Url { get; set; } = DefaultGitZipMd5Url; |
71 |
| - public UriString GitZipUrl { get; set; } = DefaultGitZipUrl; |
72 |
| - public UriString GitLfsZipMd5Url { get; set; } = DefaultGitLfsZipMd5Url; |
73 |
| - public UriString GitLfsZipUrl { get; set; } = DefaultGitLfsZipUrl; |
74 |
| - public string PackageNameWithVersion => PackageName + "_" + PackageVersion; |
75 |
| - } |
76 |
| - |
77 | 8 | class GitInstaller
|
78 | 9 | {
|
79 | 10 | private static readonly ILogging Logger = LogHelper.GetLogger<GitInstaller>();
|
@@ -238,5 +169,74 @@ private bool IsGitExtracted()
|
238 | 169 | Logger.Trace("Git Present");
|
239 | 170 | return true;
|
240 | 171 | }
|
| 172 | + |
| 173 | + public class GitInstallDetails |
| 174 | + { |
| 175 | + public const string DefaultGitZipMd5Url = "https://ghfvs-installer.github.com/unity/portable_git/git.zip.MD5.txt"; |
| 176 | + public const string DefaultGitZipUrl = "https://ghfvs-installer.github.com/unity/portable_git/git.zip"; |
| 177 | + public const string DefaultGitLfsZipMd5Url = "https://ghfvs-installer.github.com/unity/portable_git/git-lfs.zip.MD5.txt"; |
| 178 | + public const string DefaultGitLfsZipUrl = "https://ghfvs-installer.github.com/unity/portable_git/git-lfs.zip"; |
| 179 | + |
| 180 | + public const string GitExtractedMD5 = "e6cfc0c294a2312042f27f893dfc9c0a"; |
| 181 | + public const string GitLfsExtractedMD5 = "36e3ae968b69fbf42dff72311040d24a"; |
| 182 | + |
| 183 | + public const string WindowsGitExecutableMD5 = "50570ed932559f294d1a1361801740b9"; |
| 184 | + public const string MacGitExecutableMD5 = ""; |
| 185 | + |
| 186 | + public const string WindowsGitLfsExecutableMD5 = "177bb14d0c08f665a24f0d5516c3b080"; |
| 187 | + public const string MacGitLfsExecutableMD5 = "f81a1a065a26a4123193e8fd96c561ad"; |
| 188 | + |
| 189 | + private const string PackageVersion = "f02737a78695063deace08e96d5042710d3e32db"; |
| 190 | + private const string PackageName = "PortableGit"; |
| 191 | + |
| 192 | + private readonly bool onWindows; |
| 193 | + |
| 194 | + public GitInstallDetails(NPath baseDataPath, bool onWindows) |
| 195 | + { |
| 196 | + this.onWindows = onWindows; |
| 197 | + |
| 198 | + ZipPath = baseDataPath.Combine("downloads"); |
| 199 | + ZipPath.EnsureDirectoryExists(); |
| 200 | + |
| 201 | + var gitInstallPath = baseDataPath.Combine(PackageNameWithVersion); |
| 202 | + GitInstallationPath = gitInstallPath; |
| 203 | + |
| 204 | + if (onWindows) |
| 205 | + { |
| 206 | + GitExecutable += "git.exe"; |
| 207 | + GitLfsExecutable += "git-lfs.exe"; |
| 208 | + |
| 209 | + GitExecutablePath = gitInstallPath.Combine("cmd", GitExecutable); |
| 210 | + } |
| 211 | + else |
| 212 | + { |
| 213 | + GitExecutable = "git"; |
| 214 | + GitLfsExecutable = "git-lfs"; |
| 215 | + |
| 216 | + GitExecutablePath = gitInstallPath.Combine("bin", GitExecutable); |
| 217 | + } |
| 218 | + |
| 219 | + GitLfsExecutablePath = GetGitLfsExecutablePath(gitInstallPath); |
| 220 | + } |
| 221 | + |
| 222 | + public NPath GetGitLfsExecutablePath(NPath gitInstallRoot) |
| 223 | + { |
| 224 | + return onWindows |
| 225 | + ? gitInstallRoot.Combine("mingw32", "libexec", "git-core", GitLfsExecutable) |
| 226 | + : gitInstallRoot.Combine("libexec", "git-core", GitLfsExecutable); |
| 227 | + } |
| 228 | + |
| 229 | + public NPath ZipPath { get; } |
| 230 | + public NPath GitInstallationPath { get; } |
| 231 | + public string GitExecutable { get; } |
| 232 | + public NPath GitExecutablePath { get; } |
| 233 | + public string GitLfsExecutable { get; } |
| 234 | + public NPath GitLfsExecutablePath { get; } |
| 235 | + public UriString GitZipMd5Url { get; set; } = DefaultGitZipMd5Url; |
| 236 | + public UriString GitZipUrl { get; set; } = DefaultGitZipUrl; |
| 237 | + public UriString GitLfsZipMd5Url { get; set; } = DefaultGitLfsZipMd5Url; |
| 238 | + public UriString GitLfsZipUrl { get; set; } = DefaultGitLfsZipUrl; |
| 239 | + public string PackageNameWithVersion => PackageName + "_" + PackageVersion; |
241 | 240 | }
|
242 | 241 | }
|
| 242 | +} |
0 commit comments