Giter Club home page Giter Club logo

Comments (6)

jeffbyrnes avatar jeffbyrnes commented on July 18, 2024

@jshrack-ssi this is likely something with the exports_config() method, provided by the magic cookbook.

I just discovered that cookbook has been archived to a separate repo by its maintainer, @sczizzo, with the original repo deleted.

I dug up the archived version of the exports_config() method, and confirmed that is identical to the v1.5.0 published version of that method.

To save you a click:

def exports_config obj, header=nil
  obj.map do |k, v|
    if v.nil?
      k.to_s
    else
      "export #{k}=#{Shellwords.escape v.to_s}"
    end
  end.join("\n")
end

In this case, it’s that Shellwords.escape() that’s causing what you describe.

However, the string isn’t output with any quotations, so the escapes should make it work properly… Tricky business though.

from zookeeper-cookbook.

jshrack-ssi avatar jshrack-ssi commented on July 18, 2024

@jeffbyrnes Totally agree with your analysis. I actually wrapped my expression in a Shellwords.escape to see what would happen. Sure enough, it adds additional escape characters. The only real option I can think of is overwriting the entire config file to achieve the desired outcome. Thoughts?

from zookeeper-cookbook.

jeffbyrnes avatar jeffbyrnes commented on July 18, 2024

@jshrack-ssi, does it also quote your expression? If not, then the escaping might be a good thing.

Otherwise, if this is undesirable, we’ll want to abandon exports_config() in favor of our own version. Phooey. I dislike that sort of thing.

from zookeeper-cookbook.

jeffbyrnes avatar jeffbyrnes commented on July 18, 2024

A pull request is welcome, by the way; I’ve very little bandwidth right now.

from zookeeper-cookbook.

jshrack-ssi avatar jshrack-ssi commented on July 18, 2024

No, no quoting. I actually was attempting to insert quotes as it's required when using special characters in JVM options. Those too are escaped of course. Let me see what I can do with it as a workaround and I'll submit a PR if successful.

from zookeeper-cookbook.

jeffbyrnes avatar jeffbyrnes commented on July 18, 2024

I’m going to go ahead & close this out; @jshrack-ssi if you ever managed a workaround, I’d still love to see it & perhaps include it.

from zookeeper-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.