Skip to content

Commit 68e12d5

Browse files
committed
add plist installation for mac
1 parent d87195c commit 68e12d5

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

com.alekcz.pcp.plist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Label</key>
6+
<string>com.alekcz.pcp</string>
7+
<key>Program</key>
8+
<string>/usr/bin/java</string>
9+
<key>ProgramArguments</key>
10+
<array>
11+
<string>/usr/bin/java</string>
12+
<string>-jar</string>
13+
<string>/usr/local/bin/pcp-server.jar</string>
14+
</array>
15+
<key>RunAtLoad</key>
16+
<true/>
17+
<key>KeepAlive</key>
18+
<true/>
19+
</dict>
20+
</plist>

install.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,21 @@ mv -f "$download_dir/pcp" "$PWD/pcp"
4343

4444
mv -f "$download_dir/pcp-server.jar" "$PWD/pcp-server.jar"
4545

46-
mv -f "$download_dir/pcp.service" "/etc/systemd/system/pcp.service"
47-
48-
systemctl enable pcp.service
49-
50-
systemctl stop pcp.service
51-
52-
systemctl start pcp.service
46+
case "$(uname -s)" in
47+
Linux*)
48+
cp -f "$download_dir/pcp.service" "/etc/systemd/system/pcp.service"
49+
systemctl enable pcp.service
50+
systemctl start pcp.service
51+
#systemctl stop pcp.service
52+
;;
53+
Darwin*)
54+
cp -f "$download_dir/com.alekcz.pcp.plist" ~/Library/LaunchAgents/com.alekcz.pcp.plist
55+
chown "$(id -un):$(id -g)" "~/Library/LaunchAgents/com.alekcz.pcp.plist"
56+
launchctl load -w ~/Library/LaunchAgents/com.alekcz.pcp.plist
57+
#launchctl unload ~/Library/LaunchAgents/com.alekcz.pcp.plist
58+
;;
59+
esac
5360

5461
chmod a+x "$PWD/pcp"
5562

56-
echo "Successfully installed pcp in $install_dir."
63+
echo "Successfully installed pcp in $install_dir."

test/pcp/utility_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
(is (= {:name "Test" :num 1275 :end nil} (-> resp-index :body (json/decode true))))
5555
(is (= "12345678" (:body resp-text)))
5656
(is (thrown? Exception (client/get (str "http://localhost:" port "/not-there"))))
57-
(local)
57+
(println "Here" (local))
5858
(reset! scgi nil)))))
5959

6060

0 commit comments

Comments
 (0)