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

mint does not fail when Mintfile does not exists at the specified path #262

Open
Skoti opened this issue May 12, 2023 · 2 comments
Open

Comments

@Skoti
Copy link

Skoti commented May 12, 2023

This check is hiding the error when the Mintfile does not exists:

if mintFilePath.exists,
let mintfile = try? Mintfile(path: mintFilePath),
let mintFilePackage = mintfile.package(for: package.repo) {

Causing commands like:
mint run --no-install -m incorrect/path packageNameToRun
to fail because the newest version of the package was not found.
The bootstrap was done earlier with the correct Mintfile path.

Or commands like:
mint run -m incorrect/path packageNameToRun
to install the undesired newest version of the specified package and run with it ❗

Seems like the fix is not as easy as:

        let mintfile = try Mintfile(path: mintFilePath)
        if let mintFilePackage = mintfile.package(for: package.repo) {

because then 6 tests fail, I guess in some contexts it is expecting to run without Mintfile, but I don't know the internal assumptions of this project.

Anyway, surely when you specify Mintfile explicitly via -m option then it must fail if that file does not exist.
Regardless of whether it is the default path specified -m Mintfile or a custom one.

In the current state, it leads to confusion and hard-to-understand behaviours.

@r-dent
Copy link

r-dent commented Jul 5, 2023

Anyway, surely when you specify Mintfile explicitly via -m option then it must fail if that file does not exist.

+1 on that. AFAIK tools like Bundler or CocoaPods have the same behavior.

@yonaskolb
Copy link
Owner

Yes agree if the Mintfile is explicit then it should fail if not found.
In other cases Mint was designed to run packages without a Mintfile at all (that functionality came before the Mintfile even existed). I can understand if that seems like odd behaviour in certain cases.

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

No branches or pull requests

3 participants