mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 09:26:42 +00:00
Update and rename make-chrome-ssb-for-osx to create-chrome-ssb
This commit is contained in:
@@ -4,21 +4,32 @@
|
|||||||
#
|
#
|
||||||
# Credit: Borrowed from somewhere and then fixed/improved by @jimeh.
|
# Credit: Borrowed from somewhere and then fixed/improved by @jimeh.
|
||||||
|
|
||||||
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
|
echo "ERROR: create-chrome-ssb only works on Mac OS X." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
name="$1"
|
name="$1"
|
||||||
url="$2"
|
url="$2"
|
||||||
icon="$3"
|
icon="$3"
|
||||||
|
|
||||||
if [ -z "$name" ] || [ -z "$url" ]; then
|
if [ -z "$name" ] || [ -z "$url" ]; then
|
||||||
echo 'usage: make-chrome-ssb-for-osx "Google Music"' \
|
echo 'usage: create-chrome-ssb "Google Music"' \
|
||||||
'"https://play.google.com/music"'
|
'"https://play.google.com/music"'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chrome_path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
chrome_path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||||
if [ ! -f "$chrome_path" ]; then echo "ERROR: Chrome not found."; exit 1; fi
|
if [ ! -f "$chrome_path" ]; then
|
||||||
|
echo "ERROR: Chrome not found. Please install to: /Applications" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
app_path="/Applications/${name}.app"
|
app_path="/Applications/${name}.app"
|
||||||
if [ -d "$app_path" ]; then echo "ERROR: \"${app_path}\" exits."; exit 1; fi
|
if [ -d "$app_path" ]; then
|
||||||
|
echo "ERROR: \"${app_path}\" exits." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Various paths used when creating the app.
|
# Various paths used when creating the app.
|
||||||
@@ -39,7 +50,7 @@ if [ -f "$icon" ] ; then
|
|||||||
sips -s format tiff "$icon" \
|
sips -s format tiff "$icon" \
|
||||||
--out "${resource_dir}/icon.tiff" \
|
--out "${resource_dir}/icon.tiff" \
|
||||||
--resampleWidth 128 >& /dev/null
|
--resampleWidth 128 >& /dev/null
|
||||||
tiff2icns -noLarge "${resource_dir}/icon.tiff" >& /dev/null
|
tiff2icns -noLarge "${resource_dir}/icon.tiff" >&/dev/null
|
||||||
|
|
||||||
if [ -f "${resource_dir}/icon.tiff" ]; then
|
if [ -f "${resource_dir}/icon.tiff" ]; then
|
||||||
rm "${resource_dir}/icon.tiff"
|
rm "${resource_dir}/icon.tiff"
|
||||||
Reference in New Issue
Block a user