Greetings. Is there a way to pull a package and execute its commands directly from the URL, taking into account dependancy rules, eg:
swift run --package-url https://github.com/jjrscott/echo --up-to-next-minor-from 0.1 echo "Hello World"
To reiterate, I explicitly wish to take advantage of dependancy rules such as --up-to-next-minor-from 0.0.0 but avoid going through the following long, complicated, annoying, and error prone process which, when called, creates a package, adds the command repo as a dependancy, then makes the call:
[disclaimer: does not answer the question as asked]
I do think this is the wrong command to be asking for; if you want to run something twice, at the very least there's an extra network request to check if any of the tags have changed. No, I think the interesting question here is "can we expose SwiftPM's tag-choosing as its own command", which would let you do
git clone --tags https://github.com/jjrscott/echo .
git switch --detach $(swift package choose-tag --up-to-next-minor-from 0.1)
swift run echo "hello"
or even
TAG="$(swift package choose-tag --up-to-next-minor-from 0.1 --package-url https://github.com/jjrscott/echo)"
git clone -b "$TAG" https://github.com/jjrscott/echo .
swift run echo "hello"
It's longer, sure, but it makes the network accesses explicit and avoidable. And you can still wrap it in a higher-level script if you want.