Add --skip_existing option https://github.com/MarcelSimon/MigrateGitlabToGogs/issues/4
This commit is contained in:
parent
1ff061bfdf
commit
5b82b6806c
@ -22,6 +22,9 @@ parser.add_argument('--target_repo',
|
|||||||
parser.add_argument('--no_confirm',
|
parser.add_argument('--no_confirm',
|
||||||
help='Skip user confirmation of each single step',
|
help='Skip user confirmation of each single step',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
|
parser.add_argument('--skip_existing',
|
||||||
|
help='Skip repositories that already exist on remote without asking the user',
|
||||||
|
action='store_true')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@ -121,6 +124,9 @@ for i in range(len(filtered_projects)):
|
|||||||
data=dict(token=gogs_token, name=dst_name, private=True, description=src_description))
|
data=dict(token=gogs_token, name=dst_name, private=True, description=src_description))
|
||||||
if create_repo.status_code != 201:
|
if create_repo.status_code != 201:
|
||||||
print('Could not create repo %s because of %s'%(src_name,json.loads(create_repo.text)['message']))
|
print('Could not create repo %s because of %s'%(src_name,json.loads(create_repo.text)['message']))
|
||||||
|
if args.skip_existing:
|
||||||
|
print('\nSkipped')
|
||||||
|
else
|
||||||
if 'yes' != input('Do you want to skip this repo and continue with the next? (please answer yes or no) '):
|
if 'yes' != input('Do you want to skip this repo and continue with the next? (please answer yes or no) '):
|
||||||
print('\nYou decided to cancel...')
|
print('\nYou decided to cancel...')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user