-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAKE
102 lines (85 loc) · 4.63 KB
/
MAKE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
cd "$(dirname "$0")"
echo "#****# #****# #***# # #****# **#** #****# #****# #****# #****# # # "
echo "# # * # # # # # # # # # # # # * # # "
echo "###### ## ###### ## ###### ## ###### ###### ###### ## ######"
echo " ## ## ## # ## ## ## ## ## ## # ## ## #"
echo "# ## ## # ## # ## ## ## # ## ## ## # ## # ## #"
echo "###### ###### ## # ## ## ## ###### ## ## # ###### ## #"
echo "=========================================================================="
echo " This will produce a disk image for the Scripts Pack at the /Builds folder"
echo " and will automatically mount the disk image upon completion. "
echo "=========================================================================="
echo "##########################################################################"
echo "# Scripts Pack for macOS is maintained by <https://github.io/Phorofor> #"
echo "# Licensed under the BSD-2-Clause license. #"
echo "##########################################################################"
echo "# This script makes use of create-dmg by <https://github.com/andreyvit> #"
echo "# which is Copyright (c) 2008-2014 Andrey Tarantsov #"
echo "# create-dmg is licensed under the MIT License. #"
echo "##########################################################################"
echo "# This script was executed at: $(date -u)"
echo "[$(date +%H:%M:%S)]: Changing directory into the create-dmg directory"
#Change into create-dmg folder
cd "Scripts Pack - create-dmg"
#echo "[$(date +%H:%M:%S)]: Making BuildScriptsPackImage.sh executable"
#chmod +x "BuildScriptsPackImage.sh"
echo "[$(date +%H:%M:%S)]: Making create-dmg executable"
chmod +x "create-dmg"
echo "[$(date +%H:%M:%S)]: Making dmg-license.py executable"
chmod u+x "support/dmg-license.py"
#echo "[$(date +%H:%M:%S)]: Executing disk image build script"
#./BuildScriptsPackImage.sh
# Timestamp for build versions is in the format:
# 1YYYYMMDD.HHMMSS where the date and time is in UTC timezone
BUILDTIMESTAMP="1$(date -u +%Y%m%d).$(date -u +%H%M%S)"
BUILDTIMEHUMANREADABLE="$(date -u +%Y-%m-%d\ %H.%M.%S)"
#BUILDNAME="Scripts Pack - $BUILDTIMEHUMANREADABLE.dmg"
BUILDNAME="ScriptsPack.dmg"
FOLDERTEXT="R$BUILDTIMEHUMANREADABLE.icns"
echo "[$(date -u +%H:%M:%S)]: Build time is: $BUILDTIMEHUMANREADABLE (UTC) and identified as: $BUILDTIMESTAMP"
# Do a cleanup if these exist
echo "[$(date +%H:%M:%S)]: Cleaning up existing symlinks if existing"
rm -R "../Scripts Pack Source Items/System Scripts"
rm -R "../Scripts Pack Source Items/Information"
echo "[$(date +%H:%M:%S)]: Placing build timestamps in .ScriptsVersion.txt and .ScriptsVersionBuild.txt"
echo "$BUILDTIMESTAMP" > "../Scripts Pack Source Items/Scripts Pack/About Scripts Pack/.ScriptsVersion.txt"
echo "$BUILDTIMEHUMANREADABLE" > "../Scripts Pack Source Items/Scripts Pack/About Scripts Pack/.ScriptsVersionBuild.txt"
echo "[$(date +%H:%M:%S)]: Placing build icon timestamp"
cp -R ReleaseTemplateIcon.icns "../Scripts Pack Source Items/$FOLDERTEXT"
echo "[$(date +%H:%M:%S)]: Creating System Scripts and Information Symlinks"
ln -s "/Library/Scripts" "../Scripts Pack Source Items/System Scripts"
ln -s "/Volumes/Scripts Pack/Scripts Pack/About Scripts Pack/Information.scptd/Information" "../Scripts Pack Source Items/Information"
echo "[$(date +%H:%M:%S)]: Symlinks done!"
echo "[$(date +%H:%M:%S)]: Starting create-dmg"
#-—eula "SCRIPTSPACKEULA.rtf" \
./create-dmg \
--volname "Scripts Pack" \
--background SPBackgroundImage.tiff \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 64 \
--text-size 12 \
--icon "Information" 474 261 \
--icon "Install.applescript" 611 261 \
--icon "Scripts Pack" 314 261 \
--icon "System Scripts" 208 147 \
--icon "$FOLDERTEXT" 217 285 \
--hide-extension "Install.applescript" \
--hide-extension "$FOLDERTEXT" \
"../Builds/$BUILDNAME" \
"../Scripts Pack Source Items"/
echo "[$(date +%H:%M:%S)]: Performing Clean Up"
echo "[$(date +%H:%M:%S)]: Removing 'System Scripts' Symlink"
rm -R "../Scripts Pack Source Items/System Scripts"
echo "[$(date +%H:%M:%S)]: Removing 'Information' Symlink"
rm -R "../Scripts Pack Source Items/Information"
#echo "[$(date +%H:%M:%S)]: Giving BuildScriptsPackImage.sh 3 seconds before continuing!"
#sleep 5
echo "[$(date +%H:%M:%S)]: Mounting ScriptsPack.dmg"
hdiutil attach "../Builds/ScriptsPack.dmg"
echo "[$(date +%H:%M:%S)]: Removing Build Identifier Label"
rm -R "../Scripts Pack Source Items/$FOLDERTEXT"
cd ..
echo “[$(date +%H:%M:%S)]: END OF SCRIPTS PACK DMG CREATION.”
exit