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

failed to run cp .env.example .env error: command not found #393

Closed
daniel-waiguru opened this issue Nov 20, 2021 · 4 comments
Closed

failed to run cp .env.example .env error: command not found #393

daniel-waiguru opened this issue Nov 20, 2021 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@daniel-waiguru
Copy link

Getting this error while trying to run kool run setup on windows machine freshly created laravel project
failed to run cp .env.example .env error: command not found

Here is my kool.yml file content scripts.

scripts:
  artisan: kool exec app php artisan
  composer: kool exec app composer
  mysql: kool exec -e MYSQL_PWD=$DB_PASSWORD database mysql -u $DB_USERNAME $DB_DATABASE
  node-setup:
  - kool run npm install
  - kool run npm run dev
  npm: kool docker kooldev/node:14 npm
  npx: kool docker kooldev/node:14 npx
  phpunit: kool exec app php ./bin/phpunit
  reset:
  - kool run composer install
  - kool run artisan migrate:fresh --seed
  - kool run node-setup
  setup:
  - cp .env.example .env
  - kool start
  - kool run composer install
  - kool run artisan key:generate
  - kool run node-setup
@daniel-waiguru daniel-waiguru added bug Something isn't working help wanted Extra attention is needed labels Nov 20, 2021
@fabriciojs
Copy link
Member

Hey @DanielWaiguru91 - sorry for the delay, failed to notice this new issue.

So we have seen other reports about this error on Windows. Unfortunately, we don't have much QA on Windows nowadays.

It's important to point out that we strongly suggest leveraging WSL2 for your Docker base development. Running kool from within a Bash certainly would work and we have a growing community using it that way, so it's battle-tested in that setup.

What you can do

While we don't track down and fix this issue on Windows, you can remove the cp from kool.yml and have that as a manual step. This is the simplest solution.

Again, we do believe that taking a crack on WSL2 could be really worthwhile.

@danielsuguimoto
Copy link
Contributor

danielsuguimoto commented Nov 29, 2021

I guess cp is a Unix command. @fabriciojs how about replacing these non kool commands in our scripts by a kool command? We could use kooldev/bash image for that, for example

e.g.: kool docker kooldev/bash -c "cp .env.example .env"

@fabriciojs
Copy link
Member

@danielsuguimoto I think this is a good way out, yes.

@fabriciojs
Copy link
Member

This has been fixed as suggested above - newly installed presets will have the kooldev/bash image to run the cp - so we are platform-agnostic and make sure it will always work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants