mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-11 18:41:48 -05:00
Use this script to change .error to .catch using this linux script:
#!/bin/bash -ex
#Run in awx/awx/ui/client/src
FILES=`grep -l -R "\.error(\s*function\s*(data,\s*status)\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*(data,\s*status)\s*{/.catch(({data, status}) => {/g" $FILES
FILES=`grep -l -R "\.error(this\.error\.bind(this))" . | xargs`
sed -i "s/\.error(this\.error\.bind(this))/\.catch(this\.catch\.bind(this))/g" $FILES
FILES=`grep -l -R "\.error(\s*function\s*(error)\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*(error)\s*{/.catch(({error}) => {/g" $FILES
FILES=`grep -l -R "\.error(\s*function\s*(obj,\s*status)\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*(obj,\s*status)\s*{/.catch(({obj, status}) => {/g" $FILES
FILES=`grep -l -R "\.error(\s*function\s*(res,\s*status)\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*(res,\s*status)\s*{/.catch(({res, status}) => {/g" $FILES
FILES=`grep -l -R "\.error(\s*function\s*(msg,\s*code)\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*(msg,\s*code)\s*{/.catch(({msg, code}) => {/g" $FILES
FILES=`grep -l -R "\.error(\s*function\s*()\s*{" . | xargs`
sed -i "s/\.error(\s*function\s*()\s*{/.catch(() => {/g" $FILES