yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.3k stars 123 forks source link

Force mint run to use locally installed version #274

Closed Zeynal7 closed 10 months ago

Zeynal7 commented 10 months ago

Currently, whenever I use mint run, it tries to find the latest version. But I need to run installed version instead. I have the versions specified in Mintfile, and run bootstrap only once. I run the installed tools as a part of build phase. I don't want to specify the versions in two places - one in Mintfile, and another in build phase. Is there any way to force the mint run command to run whatever version is installed?

I saw this PR - https://github.com/yonaskolb/Mint/pull/166 But I believe, it only works if there is no connection. I need to specify it myself

yonaskolb commented 10 months ago

It sounds like mint isn't finding your Mintfile. Is the mint command being run in the same directory as the Mintfile, otherwise you'll need to specify the path with --mintfile path/to/Mintfile

Zeynal7 commented 10 months ago

When I run the command in folder same as mintfile, it works. But specifying the path doesn't work when running. Mintfile path specifying work with bootstrap command mint bootstrap --mintfile scripts/Mintfile but this doesn't mint run swiftlint --mintfile scripts/Mintfile So, my mintfile path it correct, but it doesn't work when I use it with run command

This is the output when specifying the path

mint run swiftlint --mintfile scripts/Mintfile
🌱 Finding latest version of SwiftLint
🌱 Cloning SwiftLint 0.54.0
🌱 Resolving package

This is the output when I am in Mintfile folder

mint run swiftlint
Linting Swift files in current working directory
Zeynal7 commented 10 months ago

I guess this is the correct order to specify the mintfile. But it is a bit weird looking. mint run --mintfile scripts/Mintfile swiftlint

yonaskolb commented 10 months ago

Ah yes the order is because you can also pass arguments to swiftlint itself