mirror of
https://github.com/frappe/bench.git
synced 2025-01-24 07:28:25 +00:00
Handle python3 version for centos
This commit is contained in:
parent
97d81b0ba4
commit
1eed28eade
@ -82,6 +82,14 @@ def install_bench(args):
|
||||
if args.user == 'root':
|
||||
raise Exception('Please run this script as a non-root user with sudo privileges, but without using sudo or pass --user=USER')
|
||||
|
||||
# Python executable
|
||||
if not args.production:
|
||||
dist_name, dist_version = get_distribution_info()
|
||||
if dist_name is 'centos':
|
||||
args.python = 'python3.6'
|
||||
else:
|
||||
args.python = 'python3'
|
||||
|
||||
# create user if not exists
|
||||
extra_vars = vars(args)
|
||||
extra_vars.update(frappe_user=args.user)
|
||||
@ -371,6 +379,11 @@ def parse_commandline_args():
|
||||
parser.add_argument('--admin-password', dest='admin_password', help='Set admin password')
|
||||
parser.add_argument('--bench-name', dest='bench_name', help='Create bench with specified name. Default name is frappe-bench')
|
||||
|
||||
# Python interpreter to be used
|
||||
parser.add_argument('--python', dest='python', default='python',
|
||||
help=argparse.SUPPRESS
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
return args
|
||||
|
@ -29,7 +29,7 @@
|
||||
register: bench_stat
|
||||
|
||||
- name: python3 bench init for develop
|
||||
command: bench init {{ bench_path }} --frappe-branch {{ branch }} --python python3
|
||||
command: bench init {{ bench_path }} --frappe-branch {{ branch }} --python {{ python }}
|
||||
args:
|
||||
creates: "{{ bench_path }}"
|
||||
when: not bench_stat.stat.exists and not production
|
||||
|
Loading…
x
Reference in New Issue
Block a user