Skip to content

Commit

Permalink
Fix: postinstall and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
thantthet committed May 9, 2020
1 parent cc0477f commit 5c2c358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions macOS/package/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
IDENTITY_APP = "Developer ID Application: H T KHIN ZAW (YQ4W4QMX9D)"
IDENTITY_INSTALLER = "Developer ID Installer: H T KHIN ZAW (YQ4W4QMX9D)"
ROOT_DIR = /tmp/KeyMagic.dst
VERSION = defaults read $(ROOT_DIR)/KeyMagic.app/Contents/Info.plist CFBundleVersion
GET_VERSION = defaults read $(ROOT_DIR)/KeyMagic.app/Contents/Info.plist CFBundleVersion
VERSION = $(shell $(GET_VERSION))
# assuming keymagic repo and keymagic-keyboards repo are in the same directory
# so you need to clone keymagic-keyboards repo to run successfully
KEYBOARDS_REPO = "../../../keymagic-keyboards/"
Expand All @@ -13,7 +14,7 @@ all: clean build
--install-location 'Library/Input Methods' \
--component-plist components.plist \
--identifier org.keymagic.pkg.app \
--version $(shell $(VERSION)) \
--version $(VERSION) \
app.pkg

pkgbuild \
Expand All @@ -28,7 +29,7 @@ all: clean build
--resources ./ \
--package-path . \
--sign $(IDENTITY_INSTALLER) \
keymagic-$(shell $(VERSION)).pkg
keymagic-$(VERSION).pkg

cp: build #components plist
pkgbuild --analyze --root $(ROOT_DIR) components.plist
Expand All @@ -51,8 +52,7 @@ build:
mkdir -p $(ROOT_DIR)
cp -r ../IMKBased/build/Release/KeyMagic.app $(ROOT_DIR)/
/usr/bin/xattr -rc $(ROOT_DIR)

sed -e 's/__VERSION__/$(shell $(VERSION))/' distribution.plist > distribution_.plist
sh -c "sed -e 's/__VERSION__/`$(GET_VERSION)`/' distribution.plist > distribution_.plist"

prepare:
mkdir -p resource/others
Expand Down
2 changes: 1 addition & 1 deletion macOS/package/resource/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ chown -R $USER "$HOME/.keymagic/"

if [ "$ALL_USERS" == "true" ]; then
rm -rf "$HOME/$IMDir/KeyMagic.app" || 0
else
else if [ -d "/$IMDir/KeyMagic.app" ]; then # if app exists in root volume
rm -rf "$HOME/$IMDir/KeyMagic.app" || 0 # self remove
exit 1 # and fail
fi
Expand Down

0 comments on commit 5c2c358

Please sign in to comment.