Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
Unity
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shane Veasy
Unity
Commits
a2e12ccb
Commit
a2e12ccb
authored
8 years ago
by
Andreia Gaita
Browse files
Options
Downloads
Patches
Plain Diff
Optionally support loading from disk instead of embedded resource
parent
ebce9712
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GitHub.Api/AssemblyResources.cs
+1
-1
1 addition, 1 deletion
src/GitHub.Api/AssemblyResources.cs
src/GitHub.Api/Installer/GitInstaller.cs
+13
-9
13 additions, 9 deletions
src/GitHub.Api/Installer/GitInstaller.cs
with
14 additions
and
10 deletions
src/GitHub.Api/AssemblyResources.cs
+
1
−
1
View file @
a2e12ccb
...
...
@@ -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
n
ull
;
return
n
ew
NPath
(
type
).
Combine
(
os
,
resource
)
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/GitHub.Api/Installer/GitInstaller.cs
+
13
−
9
View file @
a2e12ccb
...
...
@@ -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"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment