2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 00:37:51 +00:00

Merge pull request #398 from DRogue1337/develop

Add '--overwrite' flag to 'bench init' #396
This commit is contained in:
Revant Nandgaonkar 2017-05-24 16:59:58 +05:30 committed by GitHub
commit 1aeb5078cc
3 changed files with 21 additions and 1 deletions

View File

@ -10,14 +10,24 @@
file: file:
path: '/home/{{ frappe_user }}' path: '/home/{{ frappe_user }}'
mode: 'o+rx' mode: 'o+rx'
owner: '{{ frappe_user }}'
group: '{{ frappe_user }}'
recurse: yes
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
- name: Set home folder perms - name: Set home folder perms
file: file:
path: '/Users/{{ frappe_user }}' path: '/Users/{{ frappe_user }}'
mode: 'o+rx' mode: 'o+rx'
owner: '{{ frappe_user }}'
group: '{{ frappe_user }}'
recurse: yes
when: ansible_distribution == 'MacOSX' when: ansible_distribution == 'MacOSX'
- name: Set /tmp/.bench folder perms - name: Set /tmp/.bench folder perms
command: 'chown -R {{ frappe_user }}:{{ frappe_user }} {{ repo_path }}' file:
path: '{{ repo_path }}'
owner: '{{ frappe_user }}'
group: '{{ frappe_user }}'
recurse: yes
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'

View File

@ -18,6 +18,12 @@
become: yes become: yes
become_user: root become_user: root
- name: Overwrite bench if required
file:
state: absent
path: "{{ bench_path }}"
when: overwrite
- name: Check whether bench exists - name: Check whether bench exists
stat: path="{{ bench_path }}" stat: path="{{ bench_path }}"
register: bench_stat register: bench_stat

View File

@ -335,6 +335,10 @@ def parse_commandline_args():
parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False, parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False,
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
# whether to overwrite an existing bench
parser.add_argument('--overwrite', dest='overwrite', action='store_true', default=False,
help='Whether to overwrite an existing bench')
args = parser.parse_args() args = parser.parse_args()
return args return args