Skip to content

Commit 746a2d3

Browse files
author
gau1991
committed
Asking prompt before updating site
1 parent 74be238 commit 746a2d3

File tree

1 file changed

+77
-4
lines changed

1 file changed

+77
-4
lines changed

ee/cli/plugins/site.py

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,48 @@ def default(self):
461461
Log.error(self, "Can not create HTML site with HHVM")
462462

463463
if data and self.app.pargs.hhvm:
464-
data['hhvm'] = True
465-
hhvm = 1
464+
if (not self.app.pargs.experimental):
465+
Log.info(self, "HHVM is experimental feature and it may not"
466+
"work with all plugins all your site.\nYou can "
467+
"disable it by passing --hhvm=off later.\nDo you wish"
468+
" to enable HHVM now for {0}?".format(ee_domain))
469+
470+
# Check prompt
471+
check_prompt = input("Type \"y\" to continue [n]")
472+
if check_prompt != "Y" and check_prompt != "y":
473+
Log.info("Not using HHVM for site.")
474+
data['hhvm'] = False
475+
hhvm = 0
476+
else:
477+
data['hhvm'] = True
478+
hhvm = 1
479+
else:
480+
data['hhvm'] = True
481+
hhvm = 1
482+
466483
elif data:
467484
data['hhvm'] = False
468485
hhvm = 0
469486

470487
if data and self.app.pargs.pagespeed:
471-
data['pagespeed'] = True
472-
pagespeed = 1
488+
if (not self.app.pargs.experimental):
489+
Log.info(self, "PageSpeed is experimental feature and it may not"
490+
"work with all CSS/JS/Cache of your site.\nYou can "
491+
"disable it by passing --pagespeed=off later.\nDo you wish"
492+
" to enable PageSpeed now for {0}?".format(ee_domain))
493+
494+
# Check prompt
495+
check_prompt = input("Type \"y\" to continue [n]")
496+
if check_prompt != "Y" and check_prompt != "y":
497+
Log.info("Not using PageSpeed for site.")
498+
data['pagespeed'] = False
499+
pagespeed = 0
500+
else:
501+
data['pagespeed'] = True
502+
pagespeed = 1
503+
else:
504+
data['pagespeed'] = True
505+
pagespeed = 1
473506
elif data:
474507
data['pagespeed'] = False
475508
pagespeed = 0
@@ -966,6 +999,46 @@ def doupdatesite(self, pargs):
966999
pagespeed = False
9671000

9681001
if pargs.pagespeed or pargs.hhvm:
1002+
if pargs.hhvm:
1003+
if (not self.app.pargs.experimental):
1004+
Log.info(self, "HHVM is experimental feature and it may not"
1005+
"work with all plugins all your site.\nYou can "
1006+
"disable it by passing --hhvm=off later.\nDo you wish"
1007+
" to enable HHVM now for {0}?".format(ee_domain))
1008+
1009+
# Check prompt
1010+
check_prompt = input("Type \"y\" to continue [n]")
1011+
if check_prompt != "Y" and check_prompt != "y":
1012+
Log.info("Not using HHVM for site.")
1013+
data['hhvm'] = False
1014+
hhvm = False
1015+
else:
1016+
data['hhvm'] = True
1017+
hhvm = True
1018+
else:
1019+
data['hhvm'] = True
1020+
hhvm = True
1021+
1022+
if pargs.pagespeed:
1023+
if (not self.app.pargs.experimental):
1024+
Log.info(self, "PageSpeed is experimental feature and it may not"
1025+
"work with all CSS/JS/Cache of your site.\nYou can "
1026+
"disable it by passing --pagespeed=off later.\nDo you wish"
1027+
" to enable PageSpeed now for {0}?".format(ee_domain))
1028+
1029+
# Check prompt
1030+
check_prompt = input("Type \"y\" to continue [n]")
1031+
if check_prompt != "Y" and check_prompt != "y":
1032+
Log.info("Not using PageSpeed for site.")
1033+
data['pagespeed'] = False
1034+
pagespeed = False
1035+
else:
1036+
data['pagespeed'] = True
1037+
pagespeed = True
1038+
else:
1039+
data['pagespeed'] = True
1040+
pagespeed = False
1041+
9691042
if ((hhvm is old_hhvm) and (pagespeed is old_pagespeed) and
9701043
(stype == oldsitetype and cache == oldcachetype)):
9711044
return 1

0 commit comments

Comments
 (0)