Skip to content
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

Covering other jq locations #2

Closed
chrisgrieser opened this issue Feb 13, 2022 · 5 comments · Fixed by #4
Closed

Covering other jq locations #2

chrisgrieser opened this issue Feb 13, 2022 · 5 comments · Fixed by #4

Comments

@chrisgrieser
Copy link
Contributor

thanks for the nice workflow!

I tried using it, however I got an error with jq. You can fix that by adding the following line at the top:

export PATH=/usr/local/bin/:/opt/homebrew/bin/:$PATH

on M1 Macs, HomeBrew installs jq at /opt/homebrew/bin/, and adding that to the PATH ensures that you can use jq like in the shell, without worrying where a user has installed it.

#!/bin/zsh
export PATH=/usr/local/bin/:/opt/homebrew/bin/:$PATH

{{...}}

json_array=$(printf '%s
' "${cheat_list[@]}" | grep -v ":\|/" | jq -R . | jq -s .)

# Format the output as Script Filter Json Format
# shellcheck disable=SC2016
jq -n --argjson item "$json_array" -f <(echo '{"items":[$item[] as $name | {"uid":$name,"title":$name,"arg":$name,"autocomplete":$name}]}')
@gohoyer
Copy link
Owner

gohoyer commented Feb 14, 2022

Thanks for reporting this issue and pointing the fix! I'll put this on the next release soon!

@chrisgrieser
Copy link
Contributor Author

chrisgrieser commented Feb 14, 2022

just a minor thing since it seems you also develop small Alfred workflow:

Change this to external script to save the file seperately from the info.plist. That enables other's to easier see the underlying code and make PRs (e.g. I could have made a PR for this issue to save you some time 🙂 )

Screenshot 2022-02-14 16 39 22

@gohoyer
Copy link
Owner

gohoyer commented Feb 14, 2022

Implemented on Release 1.1.1

@gohoyer
Copy link
Owner

gohoyer commented Feb 14, 2022

just a minor thing since it seems you also develop small Alfred workflow:

Change this to external script to save the file seperately from the info.plist. That enables other's to easier see the underlying code and make PRs (e.g. I could have made a PR for this issue to save you some time 🙂 )

Screenshot 2022-02-14 16 39 22

Done!

@gohoyer
Copy link
Owner

gohoyer commented Feb 14, 2022

Every contribution is welcome! Thanks for the tips!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants