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

Commit b3e05d6

Browse files
Moving caches to library folder
1 parent 88adbf1 commit b3e05d6

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ public bool FirstRun
2121
return val;
2222
}
2323
}
24-
25-
[SerializeField] private string createdDate;
26-
public string CreatedDate
27-
{
28-
get { return createdDate; }
29-
}
3024
}
3125

3226
sealed class EnvironmentCache : ScriptObjectSingleton<EnvironmentCache>
@@ -83,15 +77,14 @@ public void Flush()
8377
}
8478
}
8579

86-
[Location("cache/branches.yaml", LocationAttribute.Location.UserFolder)]
80+
[Location("cache/branches.yaml", LocationAttribute.Location.LibraryFolder)]
8781
sealed class BranchCache : ScriptObjectSingleton<BranchCache>, IBranchCache
8882
{
8983
[SerializeField] private List<GitBranch> localBranches;
9084
[SerializeField] private List<GitBranch> remoteBranches;
91-
[SerializeField] private List<GitBranch> test;
85+
9286
public BranchCache()
9387
{
94-
test = new List<GitBranch>() { new GitBranch("name", "tracking", false) };
9588
}
9689

9790
public List<GitBranch> LocalBranches
@@ -104,7 +97,6 @@ public List<GitBranch> LocalBranches
10497
}
10598
set
10699
{
107-
Logging.GetLogger().Debug("Saving branches {0}", value.Join(","));
108100
localBranches = value;
109101
Save(true);
110102
}
@@ -125,7 +117,7 @@ public List<GitBranch> RemoteBranches
125117
}
126118
}
127119

128-
[Location("views/branches.yaml", LocationAttribute.Location.UserFolder)]
120+
[Location("views/branches.yaml", LocationAttribute.Location.LibraryFolder)]
129121
sealed class Favourites : ScriptObjectSingleton<Favourites>
130122
{
131123
[SerializeField] private List<string> favouriteBranches;

src/UnityExtension/Assets/Editor/GitHub.Unity/ScriptObjectSingleton.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitHub.Unity
88
[AttributeUsage(AttributeTargets.Class)]
99
class LocationAttribute : Attribute
1010
{
11-
public enum Location { PreferencesFolder, ProjectFolder, UserFolder }
11+
public enum Location { PreferencesFolder, ProjectFolder, LibraryFolder, UserFolder }
1212
public string filepath { get; set; }
1313
public LocationAttribute(string relativePath, Location location)
1414
{
@@ -21,8 +21,8 @@ public LocationAttribute(string relativePath, Location location)
2121
filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath;
2222
else if (location == Location.UserFolder)
2323
filepath = EntryPoint.Environment.UserCachePath.Combine(relativePath).ToString(SlashMode.Forward);
24-
else
25-
filepath = relativePath;
24+
else if (location == Location.LibraryFolder)
25+
filepath = EntryPoint.Environment.UnityProjectPath.Combine("Library", "gfu", relativePath);
2626
}
2727
}
2828

0 commit comments

Comments
 (0)