Error "Can't initialize a project in the non-empty directory at path" doesn't make sense when using mise

Hello, just a small feedback - I installed Tuist in a new project using mise, as recommended by the documentation.

However when I try to tuist init --platform ios, the command fails because the directory is not empty.

Of course it’s not empty, it contains mise.toml. Which is necessary to setup and use Tuist. As the documentation told me to.

Maybe this error should be turned into a warning instead? Where the user can confirm that they want to create the project in a non-empty directory?

If I rename the file to .mise.toml before running the init it works but it shows this error:
- Error: File already exists: Can't rename '/Users/user/project/.tmp-yDUUC4' to '/Users/user/project/.mise.toml' as it already exists. ('renamex_np' system call failed with '(17) File exists'.)

It looks like Tuist isn’t up to date with the latest mise, which renamed .mise.toml to mise.toml?

Hey @nathan-sofia :wave:

The .mise.toml will be automatically generated when running tuist init. Don’t create one manually before running tuist init.

Instead, tuist init should be using the version you have activated globally. You can activate it by running mise use tuist@latest as per the docs here and then you can run tuist init in an empty directory.

When I did mise use tuist@latest , mise automatically created a mise.toml file (not .mise.toml). I guess I’d have to add -g to use Tuist globally and avoid that file creation.

My problem was easily solved anyway, but I don’t think Tuist should care about how it’s installed (and by extension, not alter or create the mise manifest). I wanted to share that feedback with you. If I had used brew to install Tuist, would it have created a .mise.toml file?

I guess I’d have to add -g to use Tuist globally and avoid that file creation.

Sorry, yes, I meant mise use -g tuist@latest.

I don’t think Tuist should care about how it’s installed (and by extension, not alter or create the mise manifest)

Tuist doesn’t care about how it’s installed. tuist init does care about whether a directory is empty or not. That’s a standard for CLI tools, including for example the swift package init command.

mise use xx creates a .mise.toml which is a feature of mise and is not something Tuist has a say on.

Tuist recommends usage of Mise because we think it’s the best tool to manage Tuist in your team, but you are free to use Homebrew.

1 Like

Tuist creates a .mise.toml file when running tuist init --platform ios in an empty directory though. That’s what I was referring to.

Or is that mise that does that because I used a command from mise inside a folder?

No, you’re right, that’s Tuist.

I’m leaning to still creating that file – if you don’t use Mise then it doesn’t have any effect. It’s easy to delete it if you don’t want to use it. tuist init encapsulates our best practices in a lean project template. You can always create your own project template for initializing projects if you prefer different conventions.

That’s fine, I was just thrown off because I used the wrong steps:

Maybe the documentation here should clearly state that one should:

  • install Tuist globally
  • init the Tuist project
  • remove the created .mise.toml file if not needed

By the way it looks like mise now recommends using mise.toml instead of .mise.toml, maybe you should reflect this change in the documentation and inside tuist init? It makes sense to me to drop the ., the file has no reason to be hidden.

Maybe the documentation here should clearly state that one should:

Yeah, that’s fair, we can do that :eyes:

Yes, I agree! Would you flag an issue for that? This would be a great way for a first-time contribution if you feel like it :relieved:

Sure, I’ll make an issue. I’ll see if I have the time to contribute between all my other side projects :smiley:

Thanks for your help!

1 Like