Skip to content

Commit

Permalink
feat(brew-bump): add check for is_executable
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjoeio committed Sep 27, 2021
1 parent e834616 commit e03dafb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions ci/steps/brew-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ main() {
exit 1
fi

# TODO@jsjoeio - check that git-askpass.sh was created
# Ensure it's executable since we just created it
chmod +x "$HOME/git-askpass.sh"

# TODO@jsjoeio - check that git-askpass.sh has executable permissions
# Make sure the git-askpass.sh file is executable
if [[ $(is_executable "$HOME/git-askpass.sh") -eq 1 ]]; then
echo "git-askpass.sh is not executable."
ls -la "$HOME/git-askpass.sh"
exit 1
fi

# GIT_ASKPASS lets us use the password when pushing without revealing it in the process list
# See: https://serverfault.com/a/912788
GIT_ASKPASS="$HOME/git-askpass.sh" git push https://[email protected]/cdr-oss/homebrew-core.git --all
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/steps-lib.bats
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ source "$SCRIPT"
}

@test "file_exists should 0 if file exists" {
run file_exists "steps-lib.bats"
run file_exists "$SCRIPT"
[ "$output" = 0 ]
}

Expand Down

0 comments on commit e03dafb

Please sign in to comment.