Ionic Appflow - package.json and shell scripts


In the Build Environments docs for Appflow ( there is an example that uses a custom shell script to read the branch and triggers a custom build:


"scripts": {
    "build": "./",

if [ "$CI_GIT_REF" = "master" ]; then
    npx ionic build --prod
    npx ionic build

I am trying this exact code and seem to get a permission error when attempting to package the build. Wondering what deal is or if I am doing something wrong. Thanks.

> ./

sh: ./ Permission denied
npm ERR! errno 126
npm ERR! vipcrowd@1.0.0 build: `./`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the vipcrowd@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ionic/.npm/_logs/2019-01-04T22_29_55_359Z-debug.log

EDIT: My end goal is to use different build scripts based on the env and eventually have different cordova plugin variables based on env. So either a fix to this or alternate method would help greatly.