code-foundry 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,8 @@ prune=false
27
27
  languages_set=false
28
28
  features_set=false
29
29
  package_manager=""
30
+ gitignore_backup=""
31
+ custom_ignores=""
30
32
 
31
33
  valid_languages="typescript rust python solidity"
32
34
  valid_features="ci codeql security test draft-pr release-pr release dependabot"
@@ -57,6 +59,8 @@ workflow_enabled() {
57
59
 
58
60
  cleanup() {
59
61
  if [ -n "$temp_dir" ]; then rm -rf "$temp_dir"; fi
62
+ if [ -n "$gitignore_backup" ]; then rm -f "$gitignore_backup"; fi
63
+ if [ -n "$custom_ignores" ]; then rm -f "$custom_ignores"; fi
60
64
  }
61
65
  trap cleanup EXIT
62
66
 
@@ -195,7 +199,28 @@ for file in "${files[@]}"; do
195
199
  printf 'Would sync %s\n' "$file"
196
200
  else
197
201
  mkdir -p "$(dirname "$file")"
198
- cp "$template_file" "$file"
202
+ if [ "$file" = .gitignore ] && [ -f "$file" ]; then
203
+ # Keep repository-specific ignore rules while refreshing the shared
204
+ # baseline. This prevents a template sync from hiding generated files
205
+ # or local tooling that only one project uses.
206
+ gitignore_backup="$(mktemp)"
207
+ custom_ignores="$(mktemp)"
208
+ cp "$file" "$gitignore_backup"
209
+ cp "$template_file" "$file"
210
+ awk 'NR == FNR { seen[$0] = 1; next } /^# Repository-specific rules$/ { next } NF && !seen[$0] { print }' \
211
+ "$template_file" "$gitignore_backup" > "$custom_ignores"
212
+ if [ -s "$custom_ignores" ]; then
213
+ {
214
+ printf '\n# Repository-specific rules\n'
215
+ cat "$custom_ignores"
216
+ } >> "$file"
217
+ fi
218
+ rm -f "$gitignore_backup" "$custom_ignores"
219
+ gitignore_backup=""
220
+ custom_ignores=""
221
+ else
222
+ cp "$template_file" "$file"
223
+ fi
199
224
  case "$file" in
200
225
  .githooks/*|.github/scripts/*) chmod +x "$file" ;;
201
226
  esac
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",