<commit_before>#!/bin/bash
VERSION=0.10.9
TMP_DIR=~/tmp
BUILD_DIR=$TMP_DIR/build

rm -f $BUILD_DIR/Pritunl.unpkg/Build.pkg/{Payload,Bom}

# Create new Payload and new Bom
cd $BUILD_DIR/Pritunl.pkg
find . | cpio -o --format odc | gzip -c \
  > $BUILD_DIR/Pritunl.unpkg/Build.pkg/Payload
mkbom $BUILD_DIR/Pritunl.pkg $BUILD_DIR/Pritunl.unpkg/Build.pkg/Bom

# Get installBytes and numberOfFiles
INSTALL_BYTES=$(expr $(du -sk ~/tmp/build/Pritunl.pkg/ | awk -F ' ' ' { print $1 } ') - 4)
NUMBER_OF_FILES=`find ~/tmp/build/Pritunl.pkg/ | wc | awk -F ' ' ' { print $1 } '`

sed -E "s/(numberOfFiles=)\".*\" (installKBytes=)\".*\"/\1\"$NUMBER_OF_FILES\" \2\"$INSTALL_BYTES\"/" \
    $BUILD_DIR/Pritunl.unpkg/Build.pkg/PackageInfo > $BUILD_DIR/Pritunl.unpkg/Build.pkg/PackageInfo.tmp

# Recreate package
pkgutil --flatten $BUILD_DIR/Pritunl.unpkg/ $TMP_DIR/Pritunl.new.pkg

echo Your new package is now at $TMP_DIR/Pritunl.new.pkg<commit_msg>Updated paths<commit_after>#!/bin/bash
VERSION=0.10.9
TMP_DIR=~/tmp
BUILD_DIR=$TMP_DIR/build

rm -f $BUILD_DIR/Pritunl.unpkg/Build.pkg/{Payload,Bom}

# Create new Payload and new Bom
cd $BUILD_DIR/Pritunl.pkg
find . | cpio -o --format odc | gzip -c \
  > $BUILD_DIR/Pritunl.unpkg/Build.pkg/Payload
mkbom $BUILD_DIR/Pritunl.pkg $BUILD_DIR/Pritunl.unpkg/Build.pkg/Bom

# Get installBytes and numberOfFiles
INSTALL_BYTES=$(expr $(du -sk $BUILD_DIR/Pritunl.pkg/ | awk -F ' ' ' { print $1 } ') - 4)
NUMBER_OF_FILES=`find $BUILD_DIR/Pritunl.pkg/ | wc | awk -F ' ' ' { print $1 } '`

sed -E "s/(numberOfFiles=)\".*\" (installKBytes=)\".*\"/\1\"$NUMBER_OF_FILES\" \2\"$INSTALL_BYTES\"/" \
    $BUILD_DIR/Pritunl.unpkg/Build.pkg/PackageInfo > $BUILD_DIR/Pritunl.unpkg/Build.pkg/PackageInfo.tmp

# Recreate package
pkgutil --flatten $BUILD_DIR/Pritunl.unpkg/ $TMP_DIR/Pritunl.new.pkg

echo Your new package is now at $TMP_DIR/Pritunl.new.pkg
{'fraction_non_alphanumeric': 0.17381974248927037, 'fraction_numerical': 0.009656652360515022, 'mean_word_length': 3.9601063829787235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4830631', 'n_tokens_mistral': 818, 'n_tokens_neox': 803, 'n_words': 134}