rtCamp / Frappe-Manager

A CLI tool based on Docker Compose to easily manage Frappe based projects.
MIT License
128 stars 26 forks source link

Bug: Docker status check before running commands #20

Closed dhsathiya closed 1 year ago

dhsathiya commented 1 year ago

As, the whole stack involves Docker related commands to be run, we can by default check if Docker is running or not before execution logic of the command.

╭─devarshi@Devarshis-MacBook-Air.local ~/Downloads
╰─➤  fm create erp --frappe-branch version-15-beta --apps erpnext:version-15-beta --apps hrms:version-15-beta            130 ↵

✅ Sites directory doesn't exists! Created at -> /Users/devarshi/frappe
{'USERID': 501, 'USERGROUP': 20, 'APPS_LIST': 'erpnext:version-15-beta,hrms:version-15-beta', 'FRAPPE_BRANCH':
'version-15-beta', 'DEVELOPER_MODE': True, 'ADMIN_PASS': 'admin', 'DB_NAME': 'erp-localhost', 'SITENAME': 'erp.localhost'}
✅ Stopped all sites !
Stopping all other sites !
⢿ Pulling Docker ImagesCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
❌ NoneNone
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
❌ NoneNone
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
⡿ Starting Site❌ NoneCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

⡿ Started site
╭─devarshi@Devarshis-MacBook-Air.local ~/Downloads
╰─➤  fm create erp --frappe-branch version-15-beta --apps erpnext:version-15-beta --apps hrms:version-15-beta

{'USERID': 501, 'USERGROUP': 20, 'APPS_LIST': 'erpnext:version-15-beta,hrms:version-15-beta', 'FRAPPE_BRANCH':
'version-15-beta', 'DEVELOPER_MODE': True, 'ADMIN_PASS': 'admin', 'DB_NAME': 'erp-localhost', 'SITENAME': 'erp.localhost'}
⣷ Working❌ Site erp.localhost already exists! Aborting! ->  /Users/devarshi/frappe/erp.localhost
Xieyt commented 1 year ago

Fixed in #23 Docker running status is checked before running execution logic.