mirror of
https://github.com/FalloutCollaborationProject/FCP-Mod-Updater.git
synced 2026-07-27 17:04:05 -07:00
Add SubModule Support
This commit is contained in:
@@ -109,7 +109,7 @@ public partial class GitService : IGitService
|
|||||||
CancellationToken ct = default)
|
CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
progress?.Report("Fetching from remote...");
|
progress?.Report("Fetching from remote...");
|
||||||
var (exitCode, _, error) = await RunGitCommandAsync(path, "fetch --all --prune", ct);
|
var (exitCode, _, error) = await RunGitCommandAsync(path, "fetch --all --prune --recurse-submodules", ct);
|
||||||
|
|
||||||
if (exitCode != 0)
|
if (exitCode != 0)
|
||||||
progress?.Report($"Fetch failed: {error}");
|
progress?.Report($"Fetch failed: {error}");
|
||||||
@@ -121,7 +121,7 @@ public partial class GitService : IGitService
|
|||||||
CancellationToken ct = default)
|
CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
progress?.Report("Pulling changes...");
|
progress?.Report("Pulling changes...");
|
||||||
var (exitCode, _, error) = await RunGitCommandAsync(path, "pull --ff-only", ct);
|
var (exitCode, _, error) = await RunGitCommandAsync(path, "pull --ff-only --recurse-submodules", ct);
|
||||||
|
|
||||||
if (exitCode != 0)
|
if (exitCode != 0)
|
||||||
progress?.Report($"Pull failed: {error}");
|
progress?.Report($"Pull failed: {error}");
|
||||||
@@ -139,7 +139,7 @@ public partial class GitService : IGitService
|
|||||||
|
|
||||||
var (exitCode, error) = await RunGitCommandWithProgressAsync(
|
var (exitCode, error) = await RunGitCommandWithProgressAsync(
|
||||||
parentDir,
|
parentDir,
|
||||||
$"clone --progress \"{url}\" \"{folderName}\"",
|
$"clone --progress --recurse-submodules \"{url}\" \"{folderName}\"",
|
||||||
percentProgress,
|
percentProgress,
|
||||||
ct,
|
ct,
|
||||||
timeoutMs: 300000); // 5 minute timeout for clone
|
timeoutMs: 300000); // 5 minute timeout for clone
|
||||||
@@ -167,7 +167,11 @@ public partial class GitService : IGitService
|
|||||||
public async Task<bool> CheckoutAsync(string path, string branchOrCommit, CancellationToken ct = default)
|
public async Task<bool> CheckoutAsync(string path, string branchOrCommit, CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
var (exitCode, _, _) = await RunGitCommandAsync(path, $"checkout \"{branchOrCommit}\"", ct);
|
var (exitCode, _, _) = await RunGitCommandAsync(path, $"checkout \"{branchOrCommit}\"", ct);
|
||||||
return exitCode == 0;
|
if (exitCode != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
await RunGitCommandAsync(path, "submodule update --init --recursive", ct);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> HasLocalChangesAsync(string path, CancellationToken ct = default)
|
public async Task<bool> HasLocalChangesAsync(string path, CancellationToken ct = default)
|
||||||
|
|||||||
+2
-1
@@ -29,6 +29,7 @@
|
|||||||
"Spectre.Console": "0.53.1"
|
"Spectre.Console": "0.53.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"net10.0/linux-x64": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user