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

Use the resolve() function for more package managers #52

Open
willeccles opened this issue Oct 27, 2021 · 1 comment
Open

Use the resolve() function for more package managers #52

willeccles opened this issue Oct 27, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@willeccles
Copy link
Owner

At the moment, only xbps uses this, but presumably this would be useful for any other PM with a from command.

The function:

cpm/cpm

Lines 151 to 156 in 68ff9eb

# resolve symlinks in path to file (may or may not work for a directory, but
# I doubt there's a need for that anyway)
resolve() {
cd -P "${1%/*}" 2>/dev/null || PWD="${1%/*}"
printf '%s\n' "${PWD}/${1##*/}"
}

The usage:

cpm/cpm

Line 316 in 68ff9eb

from) xbps-query -o "$(resolve "$1")";;

This is adjacent to #51, which should be an addition to the resolve() function.

@willeccles willeccles added enhancement New feature or request good first issue Good for newcomers labels Oct 27, 2021
@willeccles willeccles linked a pull request Oct 27, 2021 that will close this issue
@eepykate
Copy link
Contributor

No good solution to use this and support multiple arguments, this is only needed on xbps, and it would just be a downgrade to force single arguments elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants