mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-27 11:14:59 +00:00
fix(cli): gitignore test scaffolding files in publish-cli tests
Tests write stdout.log/stderr.log into the test repo root, which made `git status --porcelain` non-empty and broke test 3 (non-main branch abort) by tripping the dirty-tree check first. Add a .gitignore to the test fixture repo to filter out these files.
This commit is contained in:
parent
1420ffac56
commit
c1c12c56eb
1 changed files with 9 additions and 1 deletions
|
|
@ -95,12 +95,20 @@ NODE
|
|||
EOF
|
||||
chmod +x "$repo/bin/npm"
|
||||
|
||||
# Ignore test scaffolding files so they don't make `git status` dirty.
|
||||
cat >"$repo/.gitignore" <<EOF
|
||||
stdout.log
|
||||
stderr.log
|
||||
git-push-log.txt
|
||||
bin-git/
|
||||
EOF
|
||||
|
||||
git init -q --bare "$origin"
|
||||
git -C "$repo" init -q -b main
|
||||
git -C "$repo" config user.name "Test User"
|
||||
git -C "$repo" config user.email "test@example.com"
|
||||
git -C "$repo" remote add origin "$origin"
|
||||
git -C "$repo" add cli/package.json scripts/publish-cli.sh bin/npm
|
||||
git -C "$repo" add cli/package.json scripts/publish-cli.sh bin/npm .gitignore
|
||||
git -C "$repo" commit -q -m "init"
|
||||
git -C "$repo" push -q -u origin main
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue