From d3721d02ce46e06d6eb916e797cb35c5637a1dee Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 7 Aug 2026 01:38:39 +0330 Subject: [PATCH] add Bash Context Generator and Update PowerShell Version to use Timestamp for Output File Name ... --- ContextGenerator.ps1 | 2 +- ContextGenerator.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ContextGenerator.sh diff --git a/ContextGenerator.ps1 b/ContextGenerator.ps1 index 379a16c..0feb1e4 100644 --- a/ContextGenerator.ps1 +++ b/ContextGenerator.ps1 @@ -6,4 +6,4 @@ ForEach-Object { "`n### FILE: $($_.FullName)`n" Get-Content $_.FullName } | -Out-File .\all-code.txt -Encoding utf8 \ No newline at end of file +Out-File ".\xDashboard-$(Get-Date -Format 'yyyyMMdd_HHmmss').txt" -Encoding utf8 \ No newline at end of file diff --git a/ContextGenerator.sh b/ContextGenerator.sh new file mode 100644 index 0000000..9201f8f --- /dev/null +++ b/ContextGenerator.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -euo pipefail + +timestamp="$(date +%Y%m%d_%H%M%S)" +output_file="./xDashboard-${timestamp}.txt" + +find . -type f \( \ + -name "Dockerfile" \ + -o -name "docker-compose.yaml" \ + -o -name "*.cs" \ +\) \ +-not -path "*/bin/*" \ +-not -path "*/obj/*" \ +-print0 | +while IFS= read -r -d '' file; do + printf '\n### FILE: %s\n\n' "$file" + cat "$file" +done > "$output_file" + +# echo "Context generated: $output_file" \ No newline at end of file