datreeio / datree

Prevent Kubernetes misconfigurations from reaching production (again 😤 )! From code to cloud, Datree provides an E2E policy enforcement solution to run automatic checks for rule violations. See our docs: https://hub.datree.io
https://datree.io
Apache License 2.0
6.39k stars 363 forks source link

Curl install fails in MacOS #368

Closed adifayer closed 2 years ago

adifayer commented 2 years ago

Describe the bug Curl install fails in MacOS

To Reproduce Steps to reproduce the behavior:

  1. Verify datree is not installed (inc. hidden files) in a computer w/ mac OS
  2. Run datree curl install
  3. See error

Expected behavior Datree files and folders are created

Screenshots image

dimabru commented 2 years ago

This issue happens for users that don't have /usr/local/bin on their local environment when installing datree. A good way of fixing it would be to modify the install.sh script to create /usr/local/bin directory if it doesn't exist before copying datree executable to that location

royhadad commented 2 years ago

@dimabru Does this problem occur on linux/windows as well? or only mac?

dimabru commented 2 years ago

@royhadad Good question. I'm not sure. Stands to reason that if the user decides to manually delete the folder /usr/local/bin in a linux machine the script will behave the same way.

Regardless, I think the solution should be problem focused rather than environment focused. Meaning we should not assume a folder exists before writing to it, disregarding the operating system