Skip to content

Commit 236de9a

Browse files
authored
Merge pull request #1440 from Shopify/simonyc/fix-local-github-auth-problem
fix local github auth problem
2 parents 4cec23c + 6b1fb93 commit 236de9a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/shipit/commands.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,18 @@ def git(*args)
3535
private
3636

3737
def base_env
38-
@base_env ||= Shipit.env.merge(
39-
'GITHUB_DOMAIN' => github.domain,
40-
'GITHUB_TOKEN' => github.token,
41-
'GIT_ASKPASS' => Shipit::Engine.root.join('lib', 'snippets', 'git-askpass').realpath.to_s
42-
)
38+
@base_env ||= begin
39+
env = Shipit.env.merge(
40+
'GITHUB_DOMAIN' => github.domain,
41+
'GITHUB_TOKEN' => github.token
42+
)
43+
44+
unless Rails.env.development? || Rails.env.test?
45+
env['GIT_ASKPASS'] = Shipit::Engine.root.join('lib', 'snippets', 'git-askpass').realpath.to_s
46+
end
47+
48+
env
49+
end
4350
end
4451

4552
def github

0 commit comments

Comments
 (0)