2 Commits

Author SHA1 Message Date
5892210f9d Bump version to 0.0.5 2024-03-11 17:19:03 +01:00
4b40aa64b9 Fix root file link override 2024-03-11 17:05:29 +01:00
3 changed files with 13 additions and 6 deletions

4
.vscode/launch.json vendored
View File

@@ -10,8 +10,8 @@
"request": "launch", "request": "launch",
"preLaunchTask": "build", "preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path. // If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/Alma/bin/Debug/net7.0/Alma.dll", "program": "${workspaceFolder}/src/Alma/bin/Debug/net8.0/Alma.dll",
"args": [], "args": ["link", "dotconfig", "git", "-d"],
"cwd": "${workspaceFolder}/src/Alma", "cwd": "${workspaceFolder}/src/Alma",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole", "console": "internalConsole",

View File

@@ -111,13 +111,13 @@ public class LinkCommand : RepositoryModuleCommandBase
{ {
var excludePath = Path.Combine(moduleDirectory, Path.Combine(itemToExclude.Split('/'))); var excludePath = Path.Combine(moduleDirectory, Path.Combine(itemToExclude.Split('/')));
itemsToLink.RemoveAll( itemsToLink.RemoveAll(
i => i.SourcePath == excludePath i => i.SourcePath == excludePath
|| i.SourcePath.StartsWith(excludePath + Path.DirectorySeparatorChar) || i.SourcePath.StartsWith(excludePath + Path.DirectorySeparatorChar)
); );
} }
} }
if(moduleConfiguration?.ExcludeReadme ?? false) if (moduleConfiguration?.ExcludeReadme ?? false)
{ {
foreach (var readmeFile in Enum.GetValues<ReadmeFiles>()) foreach (var readmeFile in Enum.GetValues<ReadmeFiles>())
{ {
@@ -201,7 +201,14 @@ public class LinkCommand : RepositoryModuleCommandBase
var filesToLink = new List<ItemToLink>(); var filesToLink = new List<ItemToLink>();
foreach (var file in currentDirectory.GetFiles()) foreach (var file in currentDirectory.GetFiles())
{ {
filesToLink.Add(new ItemToLink(Path.Combine(currentDirectory.FullName, file.Name), Path.Combine(currentTargetDirectory.FullName, file.Name))); if (moduleConfiguration?.Links?.ContainsKey(file.Name) ?? false)
{
filesToLink.Add(new ItemToLink(file.FullName, _pathHelperService.ResolvePath(moduleConfiguration.Links[file.Name], targetDirectory.FullName)));
}
else
{
filesToLink.Add(new ItemToLink(file.FullName, Path.Combine(currentTargetDirectory.FullName, file.Name)));
}
} }
var subDirLinksToAdd = Enumerable.Empty<ItemToLink>(); var subDirLinksToAdd = Enumerable.Empty<ItemToLink>();

View File

@@ -14,7 +14,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<VersionPrefix>0.0.4</VersionPrefix> <VersionPrefix>0.0.5</VersionPrefix>
<VersionSuffix>development</VersionSuffix> <VersionSuffix>development</VersionSuffix>
</PropertyGroup> </PropertyGroup>