<commit_before>#!/usr/bin/env python

import glob
import os
import shutil
import subprocess
import sys
import tempfile

def is_fs_case_sensitive():
  with tempfile.NamedTemporaryFile(prefix='TmP') as tmp_file:
    return(not os.path.exists(tmp_file.name.lower()))

sys.path.append(
  os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../.."))

from lib.config import PLATFORM, s3_config, enable_verbose_mode
from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put, \
                     get_out_dir, ELECTRON_DIR

RELEASE_DIR = get_out_dir()


PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']
SYMBOLS_DIR = os.path.join(RELEASE_DIR, 'breakpad_symbols')

PDB_LIST = [
  os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))
]

NPX_CMD = "npx"
if sys.platform == "win32":
    NPX_CMD += ".cmd"


def main():
  os.chdir(ELECTRON_DIR)
  if PLATFORM == 'win32':
    for pdb in PDB_LIST:
      run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)
    files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
  else:
    files = glob.glob(SYMBOLS_DIR + '/*/*/*.sym')

  for symbol_file in files:
    print("Generating Sentry src bundle for: " + symbol_file)<commit_msg>build: upload windows breakpad symbols (#25000)<commit_after>#!/usr/bin/env python

import glob
import os
import shutil
import subprocess
import sys
import tempfile

def is_fs_case_sensitive():
  with tempfile.NamedTemporaryFile(prefix='TmP') as tmp_file:
    return(not os.path.exists(tmp_file.name.lower()))

sys.path.append(
  os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../.."))

from lib.config import PLATFORM, s3_config, enable_verbose_mode
from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put, \
                     get_out_dir, ELECTRON_DIR

RELEASE_DIR = get_out_dir()


PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']
SYMBOLS_DIR = os.path.join(RELEASE_DIR, 'breakpad_symbols')

PDB_LIST = [
  os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))
]

NPX_CMD = "npx"
if sys.platform == "win32":
    NPX_CMD += ".cmd"


def main():
  os.chdir(ELECTRON_DIR)
  files = []
  if PLATFORM == 'win32':
    for pdb in PDB_LIST:
      run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)
    files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')

  files += glob.glob(SYMBOLS_DIR + '/*/*/*.sym')

  for symbol_file in files:
    print("Generating Sentry src bundle for: " + symbol_file)
{'fraction_non_alphanumeric': 0.13881242626818718, 'fraction_numerical': 0.007471490365709791, 'mean_word_length': 4.424307036247335, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3736979', 'n_tokens_mistral': 989, 'n_tokens_neox': 945, 'n_words': 182}