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

Assign account per folder #27

Open
Loukious opened this issue Feb 29, 2020 · 1 comment
Open

Assign account per folder #27

Loukious opened this issue Feb 29, 2020 · 1 comment

Comments

@Loukious
Copy link

It would be nice if we could assign different accounts to different directories for dealing with different projects where each is on a different account.

@zog
Copy link

zog commented Nov 25, 2020

FYI, i added the following lines to my .zshrv:

set-heroku-account() {
  local heroku_account_setting_path=".heroku_account"

  if [ -f "${heroku_account_setting_path}" ]; then
    local heroku_account="$(cat "${heroku_account_setting_path}")"

    echo "Using heroku account ${heroku_account}"
    heroku accounts:set $heroku_account
  fi
}
add-zsh-hook chpwd set-heroku-account
set-heroku-account

Now, adding a .heroku_account file in a folder, containing the account I want to use, makes my bash switch automatically

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

No branches or pull requests

2 participants