blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
21 stars 27 forks source link

fix(default-flatpaks): Last module definition overwrites the 1st one #263

Closed fiftydinar closed 1 week ago

lorduskordus commented 1 week ago

Shouldn't it be two separate if conditions ? Both the files have to be there and the second branch (elif) gets evaluated only when the first branch (if) is not true

Like this:

    if [ ! -f "/usr/share/bluebuild/default-flatpaks/system/install" ]; then
      cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/install /usr/share/bluebuild/default-flatpaks/system/install
    fi
    if [ ! -f "/usr/share/bluebuild/default-flatpaks/system/remove" ]; then  
      cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/remove /usr/share/bluebuild/default-flatpaks/system/remove
    fi 
fiftydinar commented 1 week ago

Shouldn't it be two separate if conditions ? Both the files have to be there and the second branch (elif) gets evaluated only when the first branch (if) is not true

Like this:

    if [ ! -f "/usr/share/bluebuild/default-flatpaks/system/install" ]; then
      cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/install /usr/share/bluebuild/default-flatpaks/system/install
    fi
    if [ ! -f "/usr/share/bluebuild/default-flatpaks/system/remove" ]; then  
      cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/remove /usr/share/bluebuild/default-flatpaks/system/remove
    fi 

I apologize, you're right, I fixed it.