Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails when using SimpleModule template and choosing to not use Git #482

Open
johlju opened this issue Jul 27, 2024 · 0 comments
Open
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@johlju
Copy link
Collaborator

johlju commented Jul 27, 2024

Problem description

Creating a module using template SimpleModule and saying no to the question to use git will make the build fail.

Verbose logs

Unhandled exception. System.IO.DirectoryNotFoundException: Cannot find the .git directory
   at GitVersion.Git.GitRepositoryInfo.GetProjectRootDirectory() in /private/tmp/gitversion-20240722-7185-xp03bq/GitVersion-6.0.0/src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs:line 88

How to reproduce

Create a module:

mkdir TestModule
cd TestModule
New-SampleModule -DestinationPath '..\' -ModuleType 'SimpleModule' -ModuleAuthor 'DSC Community contributors' -ModuleName (Split-Path -Leaf $PWD) -ModuleDescription 'no description' -LicenseType MIT -SourceDirectory 'source' -ModuleVersion '0.0.1'

Build the module:

./build.ps1 -ResolveDependency -Tasks noop
./build.ps1

Expected behavior

Module generated from template should pass build (and test).

Current behavior

Build fails with message indicating Git is required.

Suggested solution

Must be a requirement for git that is not removed when the Plaster template question for Git is set to 'No'.

Operating system the target node is running

ProductName:		macOS
ProductVersion:		14.5
BuildVersion:		23F79

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module version used

Name    Version Path
----    ------- ----
Sampler 0.118.1 /Users/johlju/source/HelpUsers/KarstenHabay/TestModule/output/RequiredModules/Sampler/0.118.1/Sampler.psd1
@johlju johlju added the bug The issue is a bug. label Jul 27, 2024
@johlju johlju added the help wanted The issue is up for grabs for anyone in the community. label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

1 participant