Skip to content
Snippets Groups Projects
Commit a2e12ccb authored by Andreia Gaita's avatar Andreia Gaita
Browse files

Optionally support loading from disk instead of embedded resource

parent ebce9712
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ namespace GitHub.Unity
String.Format("GitHub.Unity.{0}{1}.{2}", type, os, resource));
if (stream != null)
return destinationPath.Combine(resource).WriteAllBytes(stream.ToByteArray());
return null;
return new NPath(type).Combine(os, resource);
}
}
}
\ No newline at end of file
......@@ -75,7 +75,7 @@ namespace GitHub.Unity
{
if (!GitDestinationPath.FileExists())
{
logger.Debug("{0} not installed yet", GitDestinationPath);
logger.Trace("{0} not installed yet", GitDestinationPath);
return false;
}
......@@ -86,7 +86,7 @@ namespace GitHub.Unity
{
if (!GitLfsDestinationPath.FileExists())
{
logger.Debug("{0} not installed yet", GitLfsDestinationPath);
logger.Trace("{0} not installed yet", GitLfsDestinationPath);
return false;
}
......@@ -107,7 +107,7 @@ namespace GitHub.Unity
ret &= await ExtractGitLfsIfNeeded(tempPath, zipFileProgress, estimatedDurationProgress);
var archiveFilePath = AssemblyResources.ToFile(ResourceType.Platform, "gitconfig", tempPath);
if (archiveFilePath != null)
if (archiveFilePath.FileExists())
{
archiveFilePath.Copy(gitConfigDestinationPath);
}
......@@ -132,14 +132,16 @@ namespace GitHub.Unity
{
if (IsPortableGitExtracted())
{
logger.Debug("Already extracted {0}, returning", PackageDestinationDirectory);
logger.Trace("Already extracted {0}, returning", PackageDestinationDirectory);
return TaskEx.FromResult(true);
}
var archiveFilePath = AssemblyResources.ToFile(ResourceType.Platform, GitZipFile, tempPath);
if (archiveFilePath == null)
if (!archiveFilePath.FileExists())
{
return TaskEx.FromResult(false);
archiveFilePath = environment.ExtensionInstallPath.ToNPath().Combine(archiveFilePath);
if (!archiveFilePath.FileExists())
return TaskEx.FromResult(false);
}
var unzipPath = tempPath.Combine("git");
......@@ -173,14 +175,16 @@ namespace GitHub.Unity
{
if (IsGitLfsExtracted())
{
logger.Debug("Already extracted {0}, returning", GitLfsDestinationPath);
logger.Trace("Already extracted {0}, returning", GitLfsDestinationPath);
return TaskEx.FromResult(false);
}
var archiveFilePath = AssemblyResources.ToFile(ResourceType.Platform, GitLfsZipFile, tempPath);
if (archiveFilePath == null)
if (!archiveFilePath.FileExists())
{
return TaskEx.FromResult(false);
archiveFilePath = environment.ExtensionInstallPath.ToNPath().Combine(archiveFilePath);
if (!archiveFilePath.FileExists())
return TaskEx.FromResult(false);
}
var unzipPath = tempPath.Combine("git-lfs");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment