JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

path should have an option to check for existence before adding. #62

Closed trajano closed 7 months ago

trajano commented 8 months ago

Code of Conduct

What would you like to see changed/added?

Something new and amazing!

path:
  - value: |
      {{ .Home }}/.local/bin
    ifExists: true # defaults to false

This will check that the directory is present before changing path. It should be false by default to keep it speedy and in case the path is in a network drive which means it will slow startup if existence is checked.

trajano commented 8 months ago

Actually we can do further by using

ifMissing: ignore # default value
ifMissing: error # raises an error
ifMissing: create # creates the directory if missing
JanDeDobbeleer commented 7 months ago

@trajano I don't seen an issue here with validating we have this at all times. There's no value in adding a directory again.