def set_git_remote_url(git_url, bench_path='.'):
 app = git_url.rsplit('/', 1)[1].rsplit('.', 1)[0]
 if (app not in bench.app.get_apps(bench_path)):
  print 'No app named {0}'.format(app)
  sys.exit(1)
 app_dir = bench.app.get_repo_dir(app, bench_path=bench_path)
 if os.path.exists(os.path.join(app_dir, '.git')):
  exec_cmd('git remote set-url upstream {}'.format(git_url), cwd=app_dir)

def set_git_remote_url ( git_url , bench_path = '.' ) : app = git_url . rsplit ( '/' , 1 ) [ 1 ] . rsplit ( '.' , 1 ) [ 0 ] if ( app not in bench . app . get_apps ( bench_path ) ) : print 'No app named {0}' . format ( app ) sys . exit ( 1 ) app_dir = bench . app . get_repo_dir ( app , bench_path = bench_path ) if os . path . exists ( os . path . join ( app_dir , '.git' ) ) : exec_cmd ( 'git remote set-url upstream {}' . format ( git_url ) , cwd = app_dir )
set app remote git url .