-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xdg-ninja: add shell pattern matching capability #271
Conversation
I tried but due to my lack of capacity & time to waste on git, I couldn't rebase my patch on yours without messing up everything. I think I'll need some help to do it properly. In the meantime, pushing some other improvements to #264 now. |
I am not even sure if GitHub has the capability to have a PR depend on another? What you did is probably just fine as long as my PR gets merged first.
If you want to try to rebase your changes on top of mine, this should do the trick: $ git remote add ballasi git@github.com:fourchettes/xdg-ninja.git
$ git fetch ballasi
$ git checkout main
$ git rebase shell-pattern-matching
$ git push -f origin main We'll probably need to check if my commits doesn't get added in your PR. If that doesn't work as intended, you can go back to the initial state by doing the following: $ git checkout 5c14da9 -B main
$ git push -f origin main I am curious to know how GitHub would behave in that case, lmk how that went! Edit: it's apparently impossible in GitHub, so you're better off just keeping it as is. |
@b3nj5m1n Any updates on this? If there's anything wrong/that you don't like about this change, I'd happily discuss about it. |
I'm so sorry it took me this long to answer, I have no idea how I forgot about it. One problem is that the haskell version of the client doesn't support this, but since I don't think anyone (myself included) uses that for anything other than adding configs, I think that's probably alright. I'm also pretty sure While trying this out, I noticed an apparent bug in the normal xdg-ninja script, it seems like if there is only one file in Line 221 in 4aac3fb
$(jq 'if type == "object" then .files[] as $file | .name, $file.path, $file.movable, $file.help else . end' programs/* | sed -e 's/^"//' -e 's/"$//') At least that's what ChatGPT gave me, it seems to work in the few tests I've done, but I'd have to look more into the jq syntax, it's been way too long since I've done anything with it. TLDR: We need to add |
I don't seem to be able to push to this PR, but this patch should do it for now: From cfc1e56b7b3be5a0cccc9ebf51349c0e77afb462 Mon Sep 17 00:00:00 2001
From: b3nj5m1n <b3nj4m1n@gmx.net>
Date: Tue, 26 Sep 2023 22:22:38 +0200
Subject: [PATCH] Add findutils as dependency
---
README.md | 1 +
flake.nix | 1 +
2 files changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 6c3bc5e..9af8c77 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ To install xdg-ninja with [Homebrew](https://brew.sh), run `brew install xdg-nin
- your favorite POSIX-compliant shell ([bash](https://repology.org/project/bash/packages), [zsh](https://repology.org/project/zsh/packages), [dash](https://repology.org/project/dash-shell/packages), ...)
- [jq](https://repology.org/project/jq/packages) for parsing the json files
+- [find](https://repology.org/project/findutils/versions)
### Optional
diff --git a/flake.nix b/flake.nix
index 8f3a5bf..5a1be2c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -13,6 +13,7 @@
runtimeDependencies = with pkgs; [
glow
jq
+ findutils
];
overlays = [
(self: super: {
--
2.41.0 |
No problem at all!
That's true, for some reason since |
a11c364
to
9e4a280
Compare
By the way, you should probably make an issue on GitHub specific for what you found. I haven't tested it on my side yet, I will and I'll keep you posted there. |
Relaunching this to spark some discussion about #263.
The implementation wouldn't solve the first point talked about in the issue but would make up for the rest of the issue. I can also take a look at adding capability for multi-files.
I quickly tested it on my side but I'd rather have someone double check this works indeed fine, @Midblyte would you be interested in rebasing your patch on this one to test out #264?
I have also changed the
check_file
behavior to retrieve the file name so that$HOME/.test-*
would be spelled out with the actual file name if it is fine (e.g., it would print/home/user/.test-2023
).Since calls to
find
is quite costy, I have also added ahas_pattern
function to use shell pattern maching in the case the string contains*
,?
or[something]
.