def script_dir_name(script_path):
    """get script dir for old & new cli api compatibility"""
    script_path = os.path.normpath(decode_path(script_path))
    if script_path.endswith(EXT):
        path = script_path
        name = os.path.basename(script_path).replace(EXT, ".py")
    else:
        path = os.path.dirname(script_path) or "."
        name = os.path.basename(script_path)
    return path, name
get script dir for old & new cli api compatibility
airtest/utils/compat.py