File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 6
6
using System . Diagnostics ;
7
7
using System . IO ;
8
8
using System . Threading . Tasks ;
9
+ using UnityEditor ;
10
+ using UnityEngine ;
9
11
10
12
namespace CandyCoded . GitStatus
11
13
{
12
14
15
+ [ InitializeOnLoad ]
13
16
public static class Git
14
17
{
15
18
16
- #if UNITY_EDITOR_WIN
17
- private static string GitPath => @"C:\Program Files\Git\bin\git.exe" ;
18
- #else
19
- private static string GitPath => "/usr/local/bin/git" ;
20
- #endif
19
+ static Git ( )
20
+ {
21
+
22
+ GitPath = SystemInfo . operatingSystemFamily . Equals ( OperatingSystemFamily . Windows )
23
+ ? @"C:\Program Files\Git\bin\git.exe"
24
+ : "/usr/local/bin/git" ;
25
+
26
+ RepoPath = $ "{ Environment . CurrentDirectory } { Path . DirectorySeparatorChar } ";
27
+
28
+ }
29
+
30
+ private static string GitPath { get ; }
21
31
22
- private static string RepoPath => $ " { Environment . CurrentDirectory } { Path . DirectorySeparatorChar } " ;
32
+ private static string RepoPath { get ; }
23
33
24
34
public static Process GenerateProcess ( string path , string arguments )
25
35
{
You can’t perform that action at this time.
0 commit comments