Skip to content

fix: sjust gcloud reconfigure#168

Merged
paolomainardi merged 1 commit into
masterfrom
feature/fix-sjust-gcloud-use-zsh
Sep 2, 2025
Merged

fix: sjust gcloud reconfigure#168
paolomainardi merged 1 commit into
masterfrom
feature/fix-sjust-gcloud-use-zsh

Conversation

@paolomainardi

@paolomainardi paolomainardi commented Sep 2, 2025

Copy link
Copy Markdown
Member

PR Type

Bug fix


Description

  • Change shebang from bash to zsh for gcloud configuration

  • Remove trailing whitespace from multiple lines

  • Ensure compatibility with zsh shell environment

  • Fix shell environment sourcing for Google Cloud SDK


Changes walkthrough 📝

Relevant files
Bug fix
00-default.just
Update gcloud script shebang and formatting                           

sjust/recipes/00-default.just

  • Changed shebang from #!/usr/bin/env bash to #!/usr/bin/env zsh
  • Removed trailing whitespace from multiple lines throughout the
    function
  • Updated shell environment to properly work with zsh for Google Cloud
    SDK configuration
  • +10/-10 

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copilot AI review requested due to automatic review settings September 2, 2025 17:04

    Copilot AI left a comment

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Pull Request Overview

    This PR fixes the shell interpreter used in the system-gcloud-reconfigure task by changing from bash to zsh.

    Comment thread sjust/recipes/00-default.just
    @sparkfabrik-ai-bot

    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Shell Compatibility

    The script uses bash-style syntax (set -euo pipefail) with a zsh shebang. While zsh is generally compatible with bash syntax, this mixed approach could cause issues. Consider verifying that all bash constructs used are compatible with zsh or use consistent shell-specific syntax throughout.

    #!/usr/bin/env zsh
    set -euo pipefail

    @sparkfabrik-ai-bot

    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @paolomainardi

    Copy link
    Copy Markdown
    Member Author

    we need this to fix this bug:

    ❯ sjust system-gcloud-reconfigure
    Configuring Google Cloud SDK...
    Sourcing Google Cloud SDK environment...
    /opt/homebrew/share/google-cloud-sdk/path.zsh.inc: line 1: A: unbound variable
    error: Recipe system-gcloud-reconfigure failed with exit code 1
    

    The line export PATH=${0:A:h}/bin:$PATH uses zsh parameter expansion syntax:

    ${0:A:h} means: take $0 (script path), apply :A (resolve to absolute path), then :h (get head/directory)
    But when sourced from just, this expansion isn't working and the shell is interpreting A as an unbound variable

    we fix it just by run in a zsh script.

    @paolomainardi paolomainardi merged commit 61e8baa into master Sep 2, 2025
    1 of 3 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants