From 858b401142ebe2a3aefeee9a2f73535a2ef5857f Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Sun, 22 Sep 2024 17:17:51 +0200 Subject: [PATCH] build: improve Justfile --- Justfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Justfile b/Justfile index c99d776..e9694ee 100644 --- a/Justfile +++ b/Justfile @@ -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