1

I have a makefile that will deploy my current django project to my live server. Is there a way to catch the terminal command "make sync_live" and request confirmation with something like

"Deploy Changes to Live? [Y,n]"

before it executes? Either in the makefile or in a bashrc file? I'm on Ubuntu 14.04. Thanks.

Murphy4
  • 1,499
  • 2
  • 15
  • 22
  • This is a duplicate, sorry I missed it. – Murphy4 Jun 16 '14 at 18:23
  • You may also want to know about the `dialog` command. (You probably need to install it first) Then you could use: `dialog --title "Confirmation" --yesno "You want to do that?" 6 20` – hek2mgl Jun 16 '14 at 18:26

1 Answers1

3
read -p "Deploy Changes to Live? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
    # Execute if condition passes
fi
Moonhead
  • 1,570
  • 8
  • 17