<commit_before>#!/bin/bash

#immediately exit script with an error if a command fails
set -euo pipefail

FILENAME=$1
USERNAME=$2
PASSWORD=$3
CODESIGN_STRING=$4
FILEPATH=$(dirname $0)/$FILENAME

# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/login.keychain

echo "signing ${FILEPATH}"
codesign -v --deep --force -s "${CODESIGN_STRING}" ${FILEPATH}
echo "signing is done"
echo "check sign"
codesign -v ${FILEPATH} -vvvvv
echo "check sign done"<commit_msg>updated signbin.sh IDEA-171989 Signing of IDEA Mac OS application sometimes fail with "A timestamp was expected but was not found" error<commit_after>#!/bin/bash

FILENAME=$1
USERNAME=$2
PASSWORD=$3
CODESIGN_STRING=$4
FILEPATH=$(dirname $0)/$FILENAME

# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/login.keychain

attemp=1
limit=3
while [ $attemp -le $limit ]
do
  echo "signing (attemp $attemp) ${FILEPATH}"
  codesign -v --deep --force -s "${CODESIGN_STRING}" ${FILEPATH}
  echo "signing done"
  codesign -v ${FILEPATH} -vvvvv
  echo "check sign done"
  if [ "$?" != "0" ]; then
    let "attemp += 1"
    if [ $attemp -eq $limit ]; then
      #immediately exit script with an error if a command fails
      set -euo pipefail
    fi
    echo "wait for 30 sec and try to sign again"
    sleep 30;
  else
    let "attemp += $limit"
  fi
done
{'fraction_non_alphanumeric': 0.12585969738651995, 'fraction_numerical': 0.01925722145804677, 'mean_word_length': 4.069686411149826, 'pattern_counts': {'":': 0, '<': 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': '130300', 'n_tokens_mistral': 509, 'n_tokens_neox': 491, 'n_words': 170}