powder-rb / powder

Makes Pow even easier. I mean really, really, ridiculously easy
http://git.io/powder
MIT License
1.29k stars 69 forks source link

Domain "dev" is used despite upgrading to v0.4.0 #136

Closed besi closed 6 years ago

besi commented 6 years ago

I assumed the new version 0.4.0 would use .test TLDs as the default.

Here is what I did:

$ powder -v
powder 0.4.0
$ powder open someproject
LSOpenURLsWithRole() failed with error -600 for the URL http://someproject.dev/.

I would expect powder to open http://someproject.test rather than someproject.dev. Can I somehow configure powder to now use the mentioned .test TLD domains?

philnash commented 6 years ago

That is odd. I just installed powder 0.4.0 fresh, linked an app and then used the open command and it did open with a .test TLD.

Do you have a POW_DOMAINS environment variable set to .dev in your shell? If so, you can remove it to get .test as the default.

besi commented 6 years ago

I don't have $POW_DOMAINS set to anything. I do have a .powder file. But this contains only the name without the domain.

I have the same behaviour when linking a new app:

$ powder link my-app
Your application is now available at http://my-app.dev/
philnash commented 6 years ago

This is weird behaviour. Can you also check for the existence of a POW_DOMAIN environment variable?

Basically, the TLD is returned from the domain method, which is currently:

    def domain
      if File.exists? File.expand_path('~/.powconfig')
        returned_domain = %x{source ~/.powconfig; echo $POW_DOMAINS}.gsub("\n", "").split(",").first
        returned_domain = %x{source ~/.powconfig; echo $POW_DOMAIN}.gsub("\n", "") if returned_domain.nil? || returned_domain.empty?
        returned_domain = 'test' if returned_domain.nil? || returned_domain.empty?
        returned_domain
      else
        'test'
      end
    end

This is either a value from POW_DOMAINS, POW_DOMAIN or 'test'. The string "dev" is no longer in the codebase (aside from the changelog and some documentation about running in production or development environments).

besi commented 6 years ago

@philnash You're right there was a setting in ~/.powconfig:

export POW_DOMAINS=dev,devdev

I did change it and now it works as expected. Thanks for your help.