git-sync/org-sync
This commit is contained in:
parent
f9724a16a5
commit
33f8a56109
13
dotfiles/lib/shellenv/git-sync.sh
Normal file
13
dotfiles/lib/shellenv/git-sync.sh
Normal file
@ -0,0 +1,13 @@
|
||||
function git-sync {
|
||||
local target="$1"
|
||||
local destination="$2"
|
||||
cd "$destination"
|
||||
git fetch origin
|
||||
# This won't work for branches other than master
|
||||
git rebase origin/master
|
||||
|
||||
rsync -t $target/* $destination
|
||||
git commit -am "$(date)"
|
||||
git push origin HEAD
|
||||
git clean -fd
|
||||
}
|
20
resources/LaunchAgents/org.imalison.org-sync.plist
Normal file
20
resources/LaunchAgents/org.imalison.org-sync.plist
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.imalison.org-sync</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>zsh</string>
|
||||
<string>-c</string>
|
||||
<string>~/org-sync.sh</string>
|
||||
</array>
|
||||
<key>StartInterval</key>
|
||||
<integer>60</integer>
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/org.imalison.org-sync.out</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/org.imalison.org-sync.error</string>
|
||||
</dict>
|
||||
</plist>
|
Loading…
Reference in New Issue
Block a user