Grails
  1. Grails
  2. GRAILS-8269

Environment setting doesn't get used for running commands in Grails 2.0 interactive mode

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: 2.0-RC2
    • Component/s: None
    • Labels:
      None

      Description

      Problem reported on mailing list:
      http://grails.1312388.n4.nabble.com/How-to-set-custom-environment-in-Grails2-0-0-RC1-interactive-mode-td3990393.html

      tried

      grails -Dgrails.env=foo
      grails>shell
      groovy:000> grails.util.Environment.current
      ===> DEVELOPMENT

      also tried:

      grails -Dgrails.env=foo
      grails>shell -Dgrails.env=foo
      groovy:000> grails.util.Environment.current
      ===> DEVELOPMENT

      grails -Dgrails.env=foo
      grails>-Dgrails.env=foo shell
      groovy:000> grails.util.Environment.current
      ===> DEVELOPMENT

      So is it possible to specify a custom environment for the interactive
      mode or is this a bug?

        Issue Links

          Activity

          Hide
          Lari Hotari added a comment -

          Fixed in 2.0.x and master branches. Cherry-picked GRAILS-7433 fix from master to 2.0.x before fixing because that contained changes to same file (DefaultCommandLine.java)

          Show
          Lari Hotari added a comment - Fixed in 2.0.x and master branches. Cherry-picked GRAILS-7433 fix from master to 2.0.x before fixing because that contained changes to same file (DefaultCommandLine.java)
          Hide
          Lari Hotari added a comment -

          This fix has a side-effect. After running "test-app" in interactive mode, environment gets switched to "test" and commands after that get run in test environment.

          Show
          Lari Hotari added a comment - This fix has a side-effect. After running "test-app" in interactive mode, environment gets switched to "test" and commands after that get run in test environment.

            People

            • Assignee:
              Lari Hotari
              Reporter:
              Lari Hotari
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last Reviewed:

                Development