Search code examples
bashcontinuous-integrationgitlab-cimv

How can the same move command behave differently depending on the context?


This should be trivial really, I have a script that compile an app then bundle it into a dmg.

The steps are:

  1. make
  2. mv app.app/ installer/artifacts/
  3. createDMG

The problem is this runs within a CI system and it fail because it can't find the app.app in the artifacts folder. Indeed if I look at what's inside this folder I can only see a Content folder which is supposed to be app.app's child folder. Now I don't think that the command to move the app.pp folder is wrong because when I run all those 3 steps it works just fine...

I'm a bit confused now, how can 2 move command can have 2 different behaviors ?


Solution

  • If the folder installer/artifacts/ does not exist, move will rename app.app/ to installer/artifacts/

    You could do the following instead:

    make
    mkdir -p installer/artifacts/
    mv app.app installer/artifacts/
    createDMG