Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ This is a .NET Global Tool that creates project directories and seeds them with

### Single-File Console Application
- All logic exists in `src/Program.cs` - no complex project structure
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle`/`Figgle.Fonts` for ASCII headers, `Console.ForegroundColor` for output formatting
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names

### Embedded Resources Pattern
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,9 @@ on:
- '**/*.gitattributes'
jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
Expand DownExpand Up@@ -53,15 +52,9 @@ jobs:
- name: dotnet pack
run: dotnet pack solrevdev.seedfolder.sln -c Release --no-build --include-source --include-symbols

- name: setup nuget
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Publish NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rohith/publish-nuget@v2.1.1
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ dotnet run --project src/solrevdev.seedfolder.csproj myfolder
### Single File Structure
The entire application is contained in `src/Program.cs` - a single-file console application using:
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
- **Figgle** for ASCII art header generation
- **Colorful.Console** for colored console output
- **Figgle** / **Figgle.Fonts** for ASCII art header generation
- **Console.ForegroundColor** for colored console output

### Embedded Resources
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
Expand Down
51 changes: 27 additions & 24 deletions src/Program.cs
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
using McMaster.Extensions.CommandLineUtils;
using Figgle;
using Figgle.Fonts;
using System.Text;
using System.Reflection;
using System.Globalization;
Expand DownExpand Up@@ -35,17 +35,20 @@ public static async Task<int> Main(string[] args)
if (args?.Length > 0)
{
var argIndex = 0;
var haveFolderName = false;

while (argIndex < args.Length)
{
var arg = args[argIndex].ToLower(CultureInfo.InvariantCulture);

var rawArg = args[argIndex];
var arg = rawArg.ToLower(CultureInfo.InvariantCulture);

// Handle flags
if (arg is "--help" or "-h" or "-?")
{
ShowHelp();
return 0;
}

if (arg is "--version" or "-v")
{
ShowVersion();
Expand DownExpand Up@@ -106,30 +109,35 @@ public static async Task<int> Main(string[] args)
}

argIndex += 2;

// Get folder name if provided
if (argIndex < args.Length)
{
folderName = args[argIndex];
argIndex++;
}
continue;
}

if (!isQuiet)
WriteLine($"▲ Using template type: {projectType}");
break;
if (arg.StartsWith('-'))
{
WriteLine($"▲ Error: Unknown option '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Use --help to see available options.", ConsoleColor.DarkYellow);
return 1;
}
else

// This is a positional argument (the folder name)
if (haveFolderName)
{
// This is the folder name
folderName = args[argIndex];
argIndex++;
break;
WriteLine($"▲ Error: Unexpected extra argument '{rawArg}'.", ConsoleColor.DarkRed);
WriteLine("▲ Only one folder name may be specified.", ConsoleColor.DarkYellow);
return 1;
}

folderName = rawArg;
haveFolderName = true;
argIndex++;
}
}

if (!isQuiet)
{
if (templateExplicitlySpecified)
WriteLine($"▲ Using template type: {projectType}");

ShowHeader();
WriteLine($"▲ Running in the path {Directory.GetCurrentDirectory()}");
}
Expand DownExpand Up@@ -435,11 +443,6 @@ private static TemplateFile[] GetUniversalTemplate()
};
}

private static TemplateFile[] GetDefaultTemplate()
{
return GetDotnetTemplate();
}

private static void ShowTemplates()
{
WriteLine("▲ Available project templates:");
Expand Down
8 changes: 4 additions & 4 deletions src/solrevdev.seedfolder.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
<ToolCommandName>seedfolder</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<NoDefaultExcludes>true</NoDefaultExcludes>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Title>solrevdev.seedfolder</Title>
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
Expand All@@ -29,9 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Colorful.Console" Version="1.2.15" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<PackageReference Include="Figgle" Version="0.6.6" />
<PackageReference Include="Figgle.Fonts" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion tests/integration-test.ps1
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,6 +70,20 @@ try {
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
if (!(Test-Path "test-space-project")) { throw "space handling failed" }

# Test flags after the folder name
Write-Host "🔹 Testing flags after folder name (dry-run)..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
if (Test-Path "test-flags-after") { throw "flags-after-folder-name dry-run should not create directory" }

Write-Host "🔹 Testing flags interleaved around folder name..." -ForegroundColor Cyan
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
if (Test-Path "test-flags-interleaved") { throw "interleaved dry-run should not create directory" }

# Test error handling - unknown flag
Write-Host "🔹 Testing error handling - unknown flag..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>$null
if ($LASTEXITCODE -eq 0) { throw "Should have failed with unknown flag" }

# Test error handling - invalid template type
Write-Host "🔹 Testing error handling - invalid template..." -ForegroundColor Cyan
$result = dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>$null
Expand DownExpand Up@@ -97,7 +111,7 @@ try {

Write-Host "🎉 All integration tests passed!" -ForegroundColor Green
Write-Host "✅ Tested templates: dotnet, node, python, ruby, markdown, universal" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates" -ForegroundColor Green
Write-Host "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates" -ForegroundColor Green
}
catch {
Write-Host "❌ Test failed: $_" -ForegroundColor Red
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-test.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,22 @@ echo "🔹 Testing space handling..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet -t node "test space project"
[[ -d "test-space-project" ]] || { echo "❌ space handling failed"; exit 1; }

# Test flags after the folder name
echo "🔹 Testing flags after folder name (dry-run)..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- test-flags-after --dry-run --quiet -t node
[[ ! -d "test-flags-after" ]] || { echo "❌ flags-after-folder-name dry-run should not create directory"; exit 1; }

echo "🔹 Testing flags interleaved around folder name..."
dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --quiet --force -t python test-flags-interleaved --dry-run
[[ ! -d "test-flags-interleaved" ]] || { echo "❌ interleaved dry-run should not create directory"; exit 1; }

# Test error handling - unknown flag
echo "🔹 Testing error handling - unknown flag..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- --bogus test-error 2>/dev/null; then
echo "❌ Should have failed with unknown flag"
exit 1
fi

# Test error handling - invalid template type
echo "🔹 Testing error handling - invalid template..."
if dotnet run --project ../src/solrevdev.seedfolder.csproj --framework net8.0 -- -t invalidtype test-error 2>/dev/null; then
Expand DownExpand Up@@ -108,4 +124,4 @@ rm -rf "$TEST_DIR"

echo "🎉 All integration tests passed!"
echo "✅ Tested templates: dotnet, node, python, ruby, markdown, universal"
echo "✅ Tested features: dry-run, force, quiet, space handling, error handling, help, version, list-templates"
echo "✅ Tested features: dry-run, force, quiet, space handling, flags after folder name, error handling, help, version, list-templates"
Loading