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

# $1 is .app dir
# $2 is app name e.g. VolName
# $3 is background image
# $4 is Volume icons
# $5 is DS_Store
# $6 is the output DMG file path and name

set -e
set -x

tmp_dmg=/tmp/$2-dmg-tmp
tmp_dmg_mount=$tmp_dmg-mount

# Create a temporary Disk Image
/usr/bin/hdiutil create -fs HFS+ -srcfolder $1 -volname $2 -ov $tmp_dmg -format UDRW

# Attach the temporary image
/usr/bin/hdiutil attach $tmp_dmg.dmg -mountroot $tmp_dmg_mount

# Copy the background, the volume icon and DS_Store files
mkdir -p $tmp_dmg_mount/$2/.DropDMGBackground
cp $3 $tmp_dmg_mount/$2/.DropDMGBackground/
cp $4 $tmp_dmg_mount/$2/.VolumeIcon.icns
cp $5 $tmp_dmg_mount/$2/.DS_Store

# Indicate that we want a custom icon
/Applications/Xcode.app/Contents/Developer/Tools/SetFile -a -c $tmp_dmg_mount/$2<commit_msg>[refactor] Option for building DMG on Mac without XCode.app<commit_after>#!/usr/bin/env bash

# $1 is .app dir
# $2 is app name e.g. VolName
# $3 is background image
# $4 is Volume icons
# $5 is DS_Store
# $6 is the output DMG file path and name

set -e
set -x

tmp_dmg=/tmp/$2-dmg-tmp
tmp_dmg_mount=$tmp_dmg-mount

# Create a temporary Disk Image
/usr/bin/hdiutil create -fs HFS+ -srcfolder $1 -volname $2 -ov $tmp_dmg -format UDRW

# Attach the temporary image
/usr/bin/hdiutil attach $tmp_dmg.dmg -mountroot $tmp_dmg_mount

# Copy the background, the volume icon and DS_Store files
mkdir -p $tmp_dmg_mount/$2/.DropDMGBackground
cp $3 $tmp_dmg_mount/$2/.DropDMGBackground/
cp $4 $tmp_dmg_mount/$2/.VolumeIcon.icns
cp $5 $tmp_dmg_mount/$2/.DS_Store

# Indicate that we want a custom icon
if [[ -f "/Applications/Xcode.app/Contents/Developer/Tools/SetFile" ]]; then
    /Applications/Xcode.app/Contents/Developer/Tools/SetFile -a -c $tmp_dmg_mount/$2
else
    /usr/bin/SetFile -a -c $tmp_dmg_mount/$2
fi
{'fraction_non_alphanumeric': 0.11938663745892661, 'fraction_numerical': 0.019167579408543262, 'mean_word_length': 3.937837837837838, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1558507', 'n_tokens_mistral': 731, 'n_tokens_neox': 712, 'n_words': 209}