def migrate_osx_xdg_data(config):
 assert is_osx(), 'This function should only be run on OS X.'
 xdg_data_home = os.path.join(os.path.expanduser('~'), '.local', 'share')
 xdg_aj_home = os.path.join(xdg_data_home, 'autojump')
 data_path = os.path.join(xdg_aj_home, 'autojump.txt')
 backup_path = os.path.join(xdg_aj_home, 'autojump.txt.bak')
 if os.path.exists(data_path):
  move_file(data_path, config['data_path'])
 if os.path.exists(backup_path):
  move_file(backup_path, config['backup_path'])
 shutil.rmtree(xdg_aj_home)
 if (len(os.listdir(xdg_data_home)) == 0):
  shutil.rmtree(xdg_data_home)

def migrate_osx_xdg_data ( config ) : assert is_osx ( ) , 'This function should only be run on OS X.' xdg_data_home = os . path . join ( os . path . expanduser ( '~' ) , '.local' , 'share' ) xdg_aj_home = os . path . join ( xdg_data_home , 'autojump' ) data_path = os . path . join ( xdg_aj_home , 'autojump.txt' ) backup_path = os . path . join ( xdg_aj_home , 'autojump.txt.bak' ) if os . path . exists ( data_path ) : move_file ( data_path , config [ 'data_path' ] ) if os . path . exists ( backup_path ) : move_file ( backup_path , config [ 'backup_path' ] ) shutil . rmtree ( xdg_aj_home ) if ( len ( os . listdir ( xdg_data_home ) ) == 0 ) : shutil . rmtree ( xdg_data_home )
older versions incorrectly used linux xdg_data_home paths on os x .