fix(mac): fix corrupt installer

Fixes #8533 after build agent maintenance put GNU coreutils cp on path
ahead of macOS /bin/cp. This subtly changed the behaviour of the `-R`
flag such that it copied the folder into a subfolder rather than copying
the contents of the folder into the destination folder:

Original layout:

```
Install Keyman.app/Contents/MacOS/
  applet
  textinputsource
  Keyman.app/
```

Corrupted layout:

```
Install Keyman.app/Install Keyman.app/Contents/MacOS/
  applet
  textinputsource
  Keyman.app/
```

Query: should we be rolling back the path changes so that /bin is first
on the path? I am concerned about other subtle changes in behaviour in
the macOS and iOS builds. Otherwise it feels like we may need to audit
the scripts in /mac, /ios (and possibly /common, /core, /web,
/resources) for potential changes.

Annoyed that it took me so long. Also annoying that macOS fails so
subtly when a parent folder has the .app extension in its name.
This commit is contained in:
Marc Durdin 2023-04-06 21:16:41 +07:00
parent 1ebce22776
commit 97c6331b5f

View file

@ -174,7 +174,7 @@ displayInfo "Copying files from \"$SOURCE_KM_APP\"..."
find "$DEST_KM_APP" -mindepth 1 -maxdepth 1
echo "---------"
find "$DEST_KM_APP" -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf
cp -fR "$SOURCE_KM_APP/" "$DEST_KM_APP"
cp -fR "$SOURCE_KM_APP/"* "$DEST_KM_APP/"
echo "---- Listing info in /Volumes/Keyman/ ----"
echo "DEST_KM_APP=$DEST_KM_APP"