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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ssh-agent setup for 1Password in zshrc #293

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

neiromaster
Copy link
Contributor

@neiromaster neiromaster commented Apr 16, 2024

License Acceptance

  • This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.

Description

The function load-our-ssh-keys in zshrc has been updated to check for the existence of 1Password before setting up the ssh-agent. Now, the ssh-agent will only be initialized for 1Password if it's installed on the system. This change effectively prevents potential errors when 1Password is not available. Fixes #292

Type of changes

  • A helper script
  • A link to an external resource like a blog post or video
  • Text cleanups/updates
  • Test updates
  • Bug fix
  • New feature
  • Plugin list change

Checklist

  • I have read the CONTRIBUTING document.
  • I have updated the readme if this PR changes/updates quickstart functionality.
  • All new and existing tests pass.
  • Any scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh is an allowed exception)
  • Scripts are marked executable
  • Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No one should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
  • I have added a credit line to README.md for the script
  • If there was no author credit in a script added in this PR, I have added one.
  • I have confirmed that the link(s) in my PR are valid.

Copy link

codeclimate bot commented Apr 16, 2024

Code Climate has analyzed commit deeae41 and detected 0 issues on this pull request.

View more on Code Climate.

The function load-our-ssh-keys in zshrc has been updated to check for the existence of 1Password before setting up the ssh-agent. Now, the ssh-agent will only be initialized for 1Password if it's installed on the system. This change effectively prevents potential errors when 1Password is not available.

Signed-off-by: Maxim (neiromaster) Gavrilenko <[email protected]>
Comment on lines +352 to +355
# setup ssh-agent for 1password only if it's installed
if can_haz op; then
onepassword-agent-check
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

An if check here, makes sense too. 👍

Copy link
Owner

@unixorn unixorn left a comment

Choose a reason for hiding this comment

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

Nice catch, thank you!

@unixorn unixorn merged commit a20ce88 into unixorn:main Apr 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 1Password settings being triggered on startup even though I don't have it installed
3 participants