Skip to content

Commit

Permalink
* don't notify on entries made by yourself
Browse files Browse the repository at this point in the history
  • Loading branch information
ad committed May 23, 2018
1 parent 3ac0260 commit b79c073
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
10 changes: 7 additions & 3 deletions GitHubListener/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCent
if let accessToken = self.defaults.string(forKey: "GHL.access_token") {
self.accessToken = accessToken

print("access_token read", accessToken)
// print("access_token read", accessToken)
if let username = self.defaults.string(forKey: "GHL.username") {
self.username = username
updateData()
Expand Down Expand Up @@ -204,9 +204,13 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCent
let testDate:Date = commit.description.author.date
if (date != nil && date != testDate) {
if (commit.description.verification.verified) {
self.showNotification(title: "\(repo.fullName)", subtitle: "\(commit.author.login) added commit", informativeText: commit.description.message, image: commit.author.avatarUrl, url: commit.htmlUrl)
if self.username != commit.author.login { // TODO: make it customizable
self.showNotification(title: "\(repo.fullName)", subtitle: "\(commit.author.login) added commit", informativeText: commit.description.message, image: commit.author.avatarUrl, url: commit.htmlUrl)
}
} else {
self.showNotification(title: "\(repo.fullName)", subtitle: "\(commit.description.author.name) added commit", informativeText: commit.description.message, url: commit.htmlUrl)
if self.username != commit.description.author.name { // TODO: make it customizable
self.showNotification(title: "\(repo.fullName)", subtitle: "\(commit.description.author.name) added commit", informativeText: commit.description.message, url: commit.htmlUrl)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion GitHubListener/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.3</string>
<string>0.4</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
Expand Down
28 changes: 13 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
#!/bin/bash

NAME='GitHubListener'

rm -rf Release 2>/dev/null
rm -r Release 2>/dev/null

xcodebuild archive \
-scheme "$NAME" \
-archivePath Release/App.xcarchive
-scheme "GitHubListener" \
-archivePath Release/App.xcarchive

xcodebuild \
-exportArchive \
-archivePath Release/App.xcarchive \
-exportOptionsPlist export-options.plist \
-exportPath Release
-exportArchive \
-archivePath Release/App.xcarchive \
-exportOptionsPlist export-options.plist \
-exportPath Release

cd Release
rm -r App.xcarchive
sleep 2

sleep 5

VER=`mdls -raw -name kMDItemVersion $NAME.app`
# Prerequisite: npm i -g create-dmg
# create-dmg "${NAME}.app"

ARCH_NAME="$NAME.v$VER.zip"
zip -r $ARCH_NAME $NAME.app
# echo "$ARCH_NAME"
VERSION=`mdls -raw -name kMDItemVersion GitHubListener.app`
echo $VERSION
zip -r "GitHubListener.v$VERSION.zip" "GitHubListener.app"

0 comments on commit b79c073

Please sign in to comment.