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 .config/zsh/update-completions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
# Update shell completions for installed tools
# This script should be run after installing or updating tools

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ jobs:
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: './bin'
ignore_names: '*.md'
additional_files: '.config/shell/common-profile.sh .config/zsh/update-completions.sh'
15 changes: 10 additions & 5 deletions bin/git-repo-checker
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ is_git_repo() {
# Function to check for uncommitted changes
check_uncommitted_changes() {
local dir="$1"
local repo_name=$(basename "$dir")
local repo_name
repo_name=$(basename "$dir")

cd "$dir"

Expand Down Expand Up @@ -123,18 +124,21 @@ check_unpushed_commits() {
cd "$dir"

# Get current branch
local current_branch=$(git rev-parse --abbrev-ref HEAD)
local current_branch
current_branch=$(git rev-parse --abbrev-ref HEAD)

# Check if branch has upstream
local upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "")
local upstream
upstream=$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}" 2>/dev/null || echo "")

if [[ -z "$upstream" ]]; then
echo -e "${YELLOW} ⚠️ No upstream branch set for '$current_branch'${NC}"
return 1
fi

# Check for unpushed commits
local unpushed_count=$(git rev-list --count HEAD ^"$upstream" 2>/dev/null || echo "0")
local unpushed_count
unpushed_count=$(git rev-list --count HEAD ^"$upstream" 2>/dev/null || echo "0")

if [[ "$unpushed_count" -gt 0 ]]; then
echo -e "${YELLOW} ⚠️ $unpushed_count unpushed commit(s) on '$current_branch'${NC}"
Expand All @@ -151,7 +155,8 @@ check_unpushed_commits() {
# Function to process a single repository
process_repo() {
local dir="$1"
local repo_name=$(basename "$dir")
local repo_name
repo_name=$(basename "$dir")

echo -e "${BLUE}📁 $repo_name${NC}"

Expand Down
2 changes: 1 addition & 1 deletion bin/provision
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ANSIBLE_CMD=(

# Add optional arguments
[[ -n "$ASK_BECOME_PASS" ]] && ANSIBLE_CMD+=("$ASK_BECOME_PASS")
[[ -n "$SETUP_ONLY" ]] && ANSIBLE_CMD+=($SETUP_ONLY)
[[ -n "$SETUP_ONLY" ]] && ANSIBLE_CMD+=("$SETUP_ONLY")
[[ ${#REMAINING_ARGS[@]} -gt 0 ]] && ANSIBLE_CMD+=("${REMAINING_ARGS[@]}")

# Run the Ansible playbook
Expand Down
Loading