parameters: (environ_cp)
docstring: Setup --distdir and --output_user_root directories
docstring_summary: Setup --distdir and --output_user_root directories
docstring_tokens: Setup -- distdir and -- output_user_root directories
function: def setup_common_dirs(environ_cp):
      """Setup --distdir and --output_user_root directories"""
      cache_dir = os.path.join(_APOLLO_ROOT_DIR, '.cache')
      dist_dir = os.path.join(_APOLLO_ROOT_DIR, '.cache/distdir')
  
      # if cyber/setup.bash not sourced
      if 'APOLLO_CACHE_DIR' in environ_cp:
          cache_dir = environ_cp['APOLLO_CACHE_DIR']
  
      if 'APOLLO_BAZEL_DIST_DIR' in environ_cp:
          dist_dir = environ_cp['APOLLO_BAZEL_DIST_DIR']
  
      write_to_bazelrc('startup --output_user_root="{}/bazel"'.format(cache_dir))
      write_to_bazelrc('common --distdir="{}"'.format(dist_dir))
      write_to_bazelrc('common --repository_cache="{}/repos"'.format(cache_dir))
      write_to_bazelrc('build --disk_cache="{}/build"'.format(cache_dir))
      write_to_bazelrc('')
function_tokens: def setup_common_dirs ( environ_cp ) : cache_dir = os . path . join ( _APOLLO_ROOT_DIR , '.cache' ) dist_dir = os . path . join ( _APOLLO_ROOT_DIR , '.cache/distdir' ) # if cyber/setup.bash not sourced if 'APOLLO_CACHE_DIR' in environ_cp : cache_dir = environ_cp [ 'APOLLO_CACHE_DIR' ] if 'APOLLO_BAZEL_DIST_DIR' in environ_cp : dist_dir = environ_cp [ 'APOLLO_BAZEL_DIST_DIR' ] write_to_bazelrc ( 'startup --output_user_root="{}/bazel"' . format ( cache_dir ) ) write_to_bazelrc ( 'common --distdir="{}"' . format ( dist_dir ) ) write_to_bazelrc ( 'common --repository_cache="{}/repos"' . format ( cache_dir ) ) write_to_bazelrc ( 'build --disk_cache="{}/build"' . format ( cache_dir ) ) write_to_bazelrc ( '' )