Skip to content

Commit

Permalink
Removing PyInquirer dependency, and updating tasks with sudo bundle
Browse files Browse the repository at this point in the history
There's a fix for the PyInquirer breakage:
  CITGuru/PyInquirer#194
But PyInquirer doesn't have a maintainer anymore:
  CITGuru/PyInquirer#159

The sudo bundle update is because some gems have native extensions, and those
don't get installed or recognized properly by the subsequent rake build.
  • Loading branch information
bkus committed Jan 21, 2023
1 parent 899d6d2 commit 62ede88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
invoke
PyInquirer
requests
10 changes: 3 additions & 7 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import invoke
import invoke.program
import PyInquirer
import requests

script_dir = os.path.dirname(os.path.realpath(__file__))
Expand All @@ -25,11 +24,8 @@ def ask_for_confirmation(prompt, batch_mode, default):
)
confirmed = default
else:
conf_questions = [
{"type": "confirm", "name": "continue", "message": prompt, "default": True}
]
conf_answers = PyInquirer.prompt(conf_questions)
confirmed = bool(conf_answers) and conf_answers["continue"]
answer = input(f"{prompt} (y/n): ")
confirmed = answer == "y"
if not confirmed:
sys.exit("Cancelled by user")

Expand Down Expand Up @@ -130,7 +126,7 @@ def build_plugin(context):
context.run(
"vagrant ssh -- '(source .bash_profile; "
"cd /mnt/packer-mikrotik/vagrant-plugins-routeros/; "
"bundle install; "
"sudo BUNDLE_SILENCE_ROOT_WARNING=true bundle install; "
"bundle exec rake build)'"
)

Expand Down

0 comments on commit 62ede88

Please sign in to comment.