Skip to content

Conversation

@vehsamrak
Copy link
Member

Command cp is mutable, so it would be better to confirm execution to leave control to the user.

screenshot-2025-12-19-041045

@vehsamrak vehsamrak self-assigned this Dec 18, 2025
@vehsamrak
Copy link
Member Author

@samizdam
Copy link
Member

@vehsamrak thank you for suggestion.

I think, it's over much (code and logic) for this case.

I saw (and known) some user stories around this functionality:

  1. As Newbie, I want run solution with minimal commands, for fast bootstrap my projects, that need virtual hosts.
  2. As Maintainer, I want keep my projects with same (and simple as possible) dev flow, for simplest support and usage.
  3. As Hacker, I want have workaround for manipulate local .env file.

For 1 US, run without prompts and supported options is better as more simple and fast. I want keep it simple.

For 2 US, I have more than 12 projects with very similar Makefiles, and suggested difference not give benefits for long term support it's all, or I need spend many time for reuse this feature, or copy-paste to other projects.

For 3 US, you can append to .env file what you need after install and before run. Or replace it as you want.

@samizdam samizdam self-requested a review December 19, 2025 11:44
@vehsamrak
Copy link
Member Author

I think copying files on behalf of user and without user notice is bad practice, and could be considered as disrespect.

The argument for projects with very similar Makefiles is the separated function (like in gist above).

@vehsamrak
Copy link
Member Author

I stripped colors and result messages from confirmation logic to become as simple as possible

@samizdam
Copy link
Member

samizdam commented Dec 21, 2025

I think, the simplest and user friendly way is move cp call to install section, when it is needed.
And use posix option -i without some wrapping.

So, we have 2 cases:

  1. On clear install after clone cp -i work silently. If user put file before install, he should know what he want.
  2. On repeat install - script suggest with native prompt replace or not it.

install, in common work flow, called once. And call cp every time not required.

PS: on run compose up services if .env was changed.

@vehsamrak
Copy link
Member Author

Sounds decent. Main problem with this approach is that install section depends on environment variable, defined in .env - DEV_ROUTER_NETWORK. This could be mitigated by sourcing .env to shell after copying.

Take a look please

cp -i dist.env .env
docker compose pull
docker network create $(DEV_ROUTER_NETWORK)
. ./.env && docker network create $$DEV_ROUTER_NETWORK
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$$VAR from shell, instead of $(VAR) from make


.PHONY: install
install:
cp -i dist.env .env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am get feedback, from mac user: -i with n return non zero and abort execution :(

@samizdam
Copy link
Member

I think copying files on behalf of user and without user notice is bad practice, and could be considered as disrespect.

The argument for projects with very similar Makefiles is the separated function (like in gist above).

Unfortunately, make does not have package manager for simple code re-usage.

And same expected functionality, behavior and code in different projects is prior.

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

Successfully merging this pull request may close these issues.

3 participants