Skip to content

Commit 519ffa6

Browse files
committed
Update @allow-real, the message is only shown when executed
1 parent 210835b commit 519ffa6

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Bach 测试框架中提供的 API 都是以 `@` 开头的。
788788

789789
## 版本
790790

791-
Bach 当前最新的版本是 0.7.0,查看[Bach 的发布列表](https://github.com/bach-sh/bach/releases)
791+
Bach 当前最新的版本是 0.7.1,查看[Bach 的发布列表](https://github.com/bach-sh/bach/releases)
792792

793793
## 作者
794794

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ n
733733

734734
## Versioning
735735

736-
The latest version of Bach is 0.7.0, See [Bach Releases](https://github.com/bach-sh/bach/releases) for more.
736+
The latest version of Bach is 0.7.1, See [Bach Releases](https://github.com/bach-sh/bach/releases) for more.
737737

738738
## Author
739739

bach.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function .bach.initialize(){
124124
builtin source "$script" "$@"
125125
}
126126

127-
declare -a bach_core_utils=(cat chmod cut diff find env grep ls "shasum|sha1sum" mkdir mktemp rm rmdir sed sort tee touch which xargs)
127+
declare -a bach_core_utils=(cat chmod cut diff find env grep ls "shasum|sha1sum" mkdir mktemp rm rmdir sed sort tee touch uniq which xargs)
128128

129129
for util in "${bach_core_utils[@]}"; do
130130
if [[ "$util" == "shasum|"* && "$BACH_OS_NAME" == FreeBSD ]]; then
@@ -345,7 +345,7 @@ function .bach.run-tests() {
345345
builtin printf "\n"
346346
} >&2
347347
fi
348-
declare _allow_real="$(@grep "^# \\[ALLOW-REAL\\]" -- "$testresult")" || true
348+
declare _allow_real="$(@grep "^# \\[ALLOW-REAL\\]" -- "$testresult" | @sort | @uniq)" || true
349349
[[ -z "${_allow_real-}" ]] || builtin printf "${color_warn}%s${color_end}\n" "${_allow_real}" >&2
350350
@rm "$testresult" &>/dev/null
351351
done
@@ -522,8 +522,10 @@ function @mockall() {
522522
builtin export -f @mockall
523523
524524
function @allow-real() {
525-
@echo "# [ALLOW-REAL]" "$@" >&2
526-
@mock "$@" === @real "$@"
525+
@mock "$@" <<__ALLOW_REAL
526+
@echo "# [ALLOW-REAL]" "$*" >&2
527+
@real "$1" "\$@"
528+
__ALLOW_REAL
527529
}
528530
builtin export -f @allow-real
529531

release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ! sed -Ene '/^## Versioning$/,+2p' README.md | grep -F "$tag"; then
1212
exit 1
1313
fi
1414

15-
git push
15+
git push --follow-tags
1616
git push --tags
1717
hub release create -m "v${tag}"$'\n'$'\n'"Version ${tag}" "$tag"
1818

tests/release.test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test-pass-a-valid-tag() {
2424
release-sh 1.2.3
2525
}
2626
test-pass-a-valid-tag-assert() {
27-
git push
27+
git push --follow-tags
2828
git push --tags
2929
hub release create -m "v1.2.3
3030

0 commit comments

Comments
 (0)