kool-dev / kool

From local development to the cloud: web apps development with containers made easy.

Home Page:https://kool.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

daniel-waiguru opened this issue · comments

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

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.

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"

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

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.