Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken conditional in gpg.sh #49

Merged
merged 1 commit into from
Jun 27, 2019
Merged

Commits on Jun 27, 2019

  1. Fix broken conditional in gpg.sh

    Using `if [` works differently than `if [[` (the former single square
    bracket is a file, the double one is a builtin function (I think)).
    
    When using `if [` with `-eq`, it expects numbers, but `==` can deal
    with strings, which is what we want here.
    
    Some examples:
    
    ```bash
    $ if [ hello -eq hello ]; then echo yes; fi
    bash: [: hello: integer expression expected
    
    $ if [ hello == hello ]; then echo yes; fi
    yes
    
    $ if [ 1 -eq 1 ]; then echo yes; fi
    yes
    
    $ if [[ hello -eq hello ]]; then echo yes; fi
    yes
    
    $ if [[ 1 -eq 1 ]]; then echo yes; fi
    yes
    ```
    grdryn committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    e64c6ba View commit details
    Browse the repository at this point in the history