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

No CLI parameter to specify installation path directly from command line (unable to use ubuntu-make in chef) #403

Open
TomaszDom opened this issue Jan 28, 2017 · 11 comments

Comments

@TomaszDom
Copy link

Does anyone have a reliable workaround to automatically accept the default installation path when prompted? Specifically for ide eclipse-jee.

I tried using "yes", but then it doesn't set the default installation path at all and installs it into the void. "Expect" also gets confused, what I need is to set the installation path directly:

umake ide eclipse-jee --path "/home/vagrant/.local/share/umake/ide/eclipse-jee"

This would make umake useful in automatic configuration management tools (e.g. chef).

@didrocks
Copy link
Member

Hey @TomaszDom. That's indeed a good idea! I have only thought about "set the path manually if you don't want to be prompted for the default paths about it". I think this is quite easy to achieve.

I'll accept any good PR with tests for that (I don't think I have time to add this feature myself for now, maybe in few weeks). Opening it up for contributions for now, as people can set themselve in chef or such via umake ide eclipse-jee ~/.local/share/umake/ide/eclipse-jee for instance (with the repetition of terms though)

@tmk1
Copy link

tmk1 commented Feb 5, 2017

@TomaszDom I agree, additionally with #79 it makes ubuntu-make quite useless :(

@TomaszDom
Copy link
Author

Here's my workaround recipe in chef:

execute "add-ubuntu-make-ppa" do
  command "sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make --y"
  action :run
  not_if do ::File.exist?('/etc/apt/sources.list.d/ubuntu-desktop-ubuntu-ubuntu-make-xenial.list') end
end

execute "update" do
  command "sudo apt-get -y -qq update"
  action :run
end

package ['ubuntu-make', 'expect']

script 'install-eclipse' do
  interpreter 'expect'
  cwd '/home/vagrant'
  code <<-EOH
    spawn runuser -u vagrant sudo umake ide eclipse-jee
    set timeout -1
    expect {
      -regexp "Choose installation path:" {
        exp_send "\025/home/vagrant/.local/share/umake/ide/eclipse-jee\r"
        exp_continue
      }
      eof
    }
  EOH
  not_if do ::File.exist?('/home/vagrant/.local/share/umake/ide/eclipse-jee/eclipse') end
end

@LyzardKing
Copy link
Collaborator

@TomaszDom
Tell me if I'm wrong
What you would need is an option to automatically accept the default folder?

@TomaszDom
Copy link
Author

My use case does not go beyond accepting the default folder as you can see from my workaround from two months ago. It's an ugly solution to a simple problem, but it works.

@LyzardKing
Copy link
Collaborator

LyzardKing commented Apr 18, 2017 via email

@TomaszDom
Copy link
Author

Definitely a switch or something like that would help, e.g. "-y" or "--y", I'd then be able to get rid of that ugly code from production and make it a little more robust (although I haven't had any issues with it so far).

If anyone needs a custom installation path in automated environments, they will figure out a workaround like I did or adapt the code found here.

@hgarfer
Copy link
Contributor

hgarfer commented Nov 9, 2017

@TomaszDom I have another workaround that might be simpler, try yes '\n' | sudo umake ide eclipse-jee although an option in ubuntu-make would definitely be better

@LyzardKing
Copy link
Collaborator

@hgarfer, do you think that #449 could be a solution for you?
There are a few issues with it, but if you want to test it, then let me know.

@hgarfer
Copy link
Contributor

hgarfer commented Nov 10, 2017

@LyzardKing that would work for me, will try to make some time to test it, thanks!

@LyzardKing
Copy link
Collaborator

LyzardKing commented Nov 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants