Fix indentation in build scripts (#428)

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-05-23 14:27:03 -04:00
parent 94e209ac80
commit f4d9de850c
2 changed files with 81 additions and 81 deletions

View File

@ -80,8 +80,8 @@ function sign {
source_application=$1 source_application=$1
$ELECTRON_OSX_SIGN $source_application --platform darwin --verbose --identity "$SIGN_IDENTITY_OSX" $ELECTRON_OSX_SIGN $source_application --platform darwin --verbose --identity "$SIGN_IDENTITY_OSX"
codesign --verify --deep --display --verbose=4 $source_application codesign --verify --deep --display --verbose=4 $source_application
spctl --ignore-cache --no-cache --assess --type execute --verbose=4 $source_application spctl --ignore-cache --no-cache --assess --type execute --verbose=4 $source_application
} }
function installer_zip { function installer_zip {
@ -104,94 +104,94 @@ function installer_dmg {
volume_app=$volume_directory/$APPLICATION_NAME.app volume_app=$volume_directory/$APPLICATION_NAME.app
# Make sure any previous DMG was unmounted # Make sure any previous DMG was unmounted
hdiutil detach $volume_directory || true hdiutil detach $volume_directory || true
# Create temporal read-write DMG image # Create temporal read-write DMG image
rm -f $temporal_dmg rm -f $temporal_dmg
hdiutil create \ hdiutil create \
-srcfolder $source_directory \ -srcfolder $source_directory \
-volname "$APPLICATION_NAME" \ -volname "$APPLICATION_NAME" \
-fs HFS+ \ -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" \ -fsargs "-c c=64,a=16,e=16" \
-format UDRW \ -format UDRW \
-size 600M $temporal_dmg -size 600M $temporal_dmg
# Mount temporal DMG image, so we can modify it # Mount temporal DMG image, so we can modify it
hdiutil attach $temporal_dmg -readwrite -noverify hdiutil attach $temporal_dmg -readwrite -noverify
# Wait for a bit to ensure the image is mounted # Wait for a bit to ensure the image is mounted
sleep 2 sleep 2
# Link to /Applications within the DMG # Link to /Applications within the DMG
pushd $volume_directory pushd $volume_directory
ln -s /Applications ln -s /Applications
popd popd
# Symlink MacOS/Etcher to MacOS/Electron since for some reason, the Electron # Symlink MacOS/Etcher to MacOS/Electron since for some reason, the Electron
# binary tries to be ran in some systems. # binary tries to be ran in some systems.
# See https://github.com/Microsoft/vscode/issues/92 # See https://github.com/Microsoft/vscode/issues/92
cp -p $volume_app/Contents/MacOS/Etcher $volume_app/Contents/MacOS/Electron cp -p $volume_app/Contents/MacOS/Etcher $volume_app/Contents/MacOS/Electron
# Set the DMG icon image # Set the DMG icon image
# Writing this hexadecimal buffer to the com.apple.FinderInfo # Writing this hexadecimal buffer to the com.apple.FinderInfo
# extended attribute does the trick. # extended attribute does the trick.
# See https://github.com/LinusU/node-appdmg/issues/14#issuecomment-29080500 # See https://github.com/LinusU/node-appdmg/issues/14#issuecomment-29080500
cp assets/icon.icns $volume_directory/.VolumeIcon.icns cp assets/icon.icns $volume_directory/.VolumeIcon.icns
xattr -wx com.apple.FinderInfo \ xattr -wx com.apple.FinderInfo \
"0000000000000000040000000000000000000000000000000000000000000000" $volume_directory "0000000000000000040000000000000000000000000000000000000000000000" $volume_directory
# Configure background image. # Configure background image.
# We use tiffutil to create a "Multirepresentation Tiff file". # We use tiffutil to create a "Multirepresentation Tiff file".
# This allows us to show the retina and non-retina image when appropriate. # This allows us to show the retina and non-retina image when appropriate.
mkdir $volume_directory/.background mkdir $volume_directory/.background
tiffutil -cathidpicheck assets/osx/installer.png assets/osx/installer@2x.png \ tiffutil -cathidpicheck assets/osx/installer.png assets/osx/installer@2x.png \
-out $volume_directory/.background/installer.tiff -out $volume_directory/.background/installer.tiff
# This AppleScript performs the following tasks # This AppleScript performs the following tasks
# - Set the window basic properties. # - Set the window basic properties.
# - Set the window size and position. # - Set the window size and position.
# - Set the icon size. # - Set the icon size.
# - Arrange the icons. # - Arrange the icons.
echo ' echo '
tell application "Finder" tell application "Finder"
tell disk "'${APPLICATION_NAME}'" tell disk "'${APPLICATION_NAME}'"
open open
set current view of container window to icon view set current view of container window to icon view
set toolbar visible of container window to false set toolbar visible of container window to false
set statusbar visible of container window to false set statusbar visible of container window to false
set the bounds of container window to {400, 100, 944, 530} set the bounds of container window to {400, 100, 944, 530}
set viewOptions to the icon view options of container window set viewOptions to the icon view options of container window
set arrangement of viewOptions to not arranged set arrangement of viewOptions to not arranged
set icon size of viewOptions to 110 set icon size of viewOptions to 110
set background picture of viewOptions to file ".background:installer.tiff" set background picture of viewOptions to file ".background:installer.tiff"
set position of item "'${APPLICATION_NAME}.app'" of container window to {140, 225} set position of item "'${APPLICATION_NAME}.app'" of container window to {140, 225}
set position of item "Applications" of container window to {415, 225} set position of item "Applications" of container window to {415, 225}
close close
open open
update without registering applications update without registering applications
delay 2 delay 2
close close
end tell end tell
end tell end tell
' | osascript ' | osascript
sync sync
sign $volume_app sign $volume_app
# Unmount temporal DMG image. # Unmount temporal DMG image.
hdiutil detach $volume_directory hdiutil detach $volume_directory
# Convert temporal DMG image into a production-ready # Convert temporal DMG image into a production-ready
# compressed and read-only DMG image. # compressed and read-only DMG image.
mkdir -p $output_directory mkdir -p $output_directory
rm -f $output_directory/Etcher-darwin-x64.dmg rm -f $output_directory/Etcher-darwin-x64.dmg
hdiutil convert $temporal_dmg \ hdiutil convert $temporal_dmg \
-format UDZO \ -format UDZO \
-imagekey zlib-level=9 \ -imagekey zlib-level=9 \
-o $output_directory/Etcher-darwin-x64.dmg -o $output_directory/Etcher-darwin-x64.dmg
# Cleanup temporal DMG image. # Cleanup temporal DMG image.
rm $temporal_dmg rm $temporal_dmg
} }

View File

@ -93,14 +93,14 @@ function package_x86 {
--out=$output_directory --out=$output_directory
# Change ia32 suffix to x86 for consistency # Change ia32 suffix to x86 for consistency
mv $output_directory/Etcher-linux-ia32 $output_package mv $output_directory/Etcher-linux-ia32 $output_package
mv $output_package/Etcher $output_package/etcher mv $output_package/Etcher $output_package/etcher
chmod a+x $output_package/*.so* chmod a+x $output_package/*.so*
# UPX fails for some reason with some other so libraries # UPX fails for some reason with some other so libraries
# other than libnode.so in the x86 build # other than libnode.so in the x86 build
upx -9 $output_package/etcher $output_package/libnode.so upx -9 $output_package/etcher $output_package/libnode.so
} }
@ -119,9 +119,9 @@ function package_x64 {
--overwrite \ --overwrite \
--out=$output_directory --out=$output_directory
mv $output_package/Etcher $output_package/etcher mv $output_package/Etcher $output_package/etcher
chmod a+x $output_package/*.so* chmod a+x $output_package/*.so*
upx -9 $output_package/etcher $output_package/*.so* upx -9 $output_package/etcher $output_package/*.so*
} }
function app_dir_create { function app_dir_create {