Skip to content

Commit

Permalink
build: improve Justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Sep 22, 2024
1 parent fb22986 commit ed0c502
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
set quiet := true

workflow_uid := `basename "$PWD"` # REQUIRED local workflow uses same folder name
prefs_location := `defaults read com.runningwithcrayons.Alfred-Preferences syncfolder | sed "s|^~|$HOME|"`
local_workflow := prefs_location / "Alfred.alfredpreferences/workflows" / workflow_uid

#───────────────────────────────────────────────────────────────────────────────

transfer-changes-FROM-local:
#!/usr/bin/env zsh
workflow_id=$(basename "$PWD")
prefs_location=$(grep '"5"' "$HOME/Library/Application Support/Alfred/prefs.json" | cut -d'"' -f4 | sed -e 's|\\/|/|g' -e "s|^~|$HOME|")
local_workflow="$prefs_location/Alfred.alfredpreferences/workflows/$workflow_id"
rsync --archive --delete --exclude-from="$PWD/.rsync-exclude" "$local_workflow/" "$PWD"
rsync --archive --delete --exclude-from="$PWD/.rsync-exclude" "{{ local_workflow }}/" "$PWD"
git status --short
transfer-changes-TO-local:
#!/usr/bin/env zsh
workflow_id=$(basename "$PWD")
prefs_location=$(grep '"5"' "$HOME/Library/Application Support/Alfred/prefs.json" | cut -d'"' -f4 | sed -e 's|\\/|/|g' -e "s|^~|$HOME|")
local_workflow="$prefs_location/Alfred.alfredpreferences/workflows/$workflow_id"
rsync --archive --delete --exclude-from="$PWD/.rsync-exclude" "$PWD/" "$local_workflow"
rsync --archive --delete --exclude-from="$PWD/.rsync-exclude" "$PWD/" "{{ local_workflow }}"
cd "{{ local_workflow }}"
git status --short
release:
zsh ./.build-and-release.sh

0 comments on commit ed0c502

Please sign in to comment.