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 scripts/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ run_package() {
}

RECHECK=()
for pkg_file in $(printf '%s\n' "${AURTOMATOR_DIR}"/packages/*.yml | sort); do
for pkg_file in "${AURTOMATOR_DIR}"/packages/*.yml; do
[[ -f "$pkg_file" ]] || continue
run_package "$pkg_file" 1
done
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ table_header="| Package | Version | Strategy | Updated | Status |
pkg_count=0
pkg_ok=0
pkg_fail=0
for pkg_file in $(printf '%s\n' "${AURTOMATOR_DIR}"/packages/*.yml | sort); do
for pkg_file in "${AURTOMATOR_DIR}"/packages/*.yml; do
[[ -f "$pkg_file" ]] || continue

name=$(pkg_get "$pkg_file" .name)
Expand Down
30 changes: 30 additions & 0 deletions tests/scripts.bats
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,36 @@ EOF
[[ "$output" == *"Checked: 0"* ]]
}

# === project path with a space ===

# Helper: a project at "$TEST_TMPDIR/my project" with the scripts and
# strategies of the test project and one package, pkg, that is up to date
make_spaced_project() {
SPACED="$TEST_TMPDIR/my project"
mkdir -p "$SPACED/packages"
ln -s "$TEST_TMPDIR/scripts" "$SPACED/scripts"
ln -s "$TEST_TMPDIR/strategies" "$SPACED/strategies"
printf '%s\n' "name: pkg" "strategy: github-release" "upstream:" " project: owner/repo" \
"current: '2.0.0'" >"$SPACED/packages/pkg.yml"
}

@test "check-all: finds the packages of a project whose path has a space" {
make_spaced_project
run "$SPACED/scripts/check-all.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"Checked: 1, Updated: 0, Errors: 0"* ]]
[ "$(cat "$SPACED/.status/pkg")" = "up_to_date" ]
}

@test "update-readme: lists the packages of a project whose path has a space" {
make_spaced_project
printf '%s\n' '<!-- PACKAGES:START -->' '<!-- PACKAGES:END -->' >"$SPACED/README.md"
git -C "$SPACED" init -q
run "$SPACED/scripts/update-readme.sh"
[ "$status" -eq 0 ]
grep -q '\[pkg\]' "$SPACED/README.md"
}

# === update-readme.sh ===

@test "update-readme: generates status table" {
Expand Down
Loading