From 2b47bfba472cb86d391781d8d62a58e8ce16de3d Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Tue, 29 Jul 2025 23:27:43 +0200 Subject: [PATCH] Add patag alias --- .claude/settings.json | 3 ++- CLAUDE.md | 5 +++++ modules/papis.nix | 10 ++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 CLAUDE.md diff --git a/.claude/settings.json b/.claude/settings.json index 26b18d3..8c04397 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,7 +1,8 @@ { "permissions": { "allow": [ - "Bash(git:*)" + "Bash(git:*)", + "Bash(exec zsh)" ], "deny": [] } diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..998ee38 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +## Nix Configuration System + +- This is my nix configuration system. Whenever you need to introduce update to my config, remember to check the current config. +- When you are going to introduce update to my nix config, do it on a experimental branch (use 'nightly'), and commit to that branch after you perform test to check the updates work as intended. Never work on the master branch which I will perform merge manually. +- After you introduce updates, remember to reflect those updates in the readme, should they bring any changes. \ No newline at end of file diff --git a/modules/papis.nix b/modules/papis.nix index f14df78..afdd519 100644 --- a/modules/papis.nix +++ b/modules/papis.nix @@ -115,16 +115,18 @@ local tags_string="$1" local query="$2" - # Split tags by # and build --add arguments + # Build --add arguments by processing each tag local add_args="" - IFS='#' read -ra tags <<< "$tags_string" - for tag in "${tags[@]}"; do - # Trim whitespace and add to arguments + local oldIFS="$IFS" + IFS='#' + for tag in $tags_string; do + # Trim whitespace tag=$(echo "$tag" | xargs) if [ -n "$tag" ]; then add_args="$add_args --add \"$tag\"" fi done + IFS="$oldIFS" # Execute the papis tag command eval "papis tag $add_args \"$query\""