Skip to content

Instantly share code, notes, and snippets.

@msgirlperl
Created June 17, 2020 15:23
Show Gist options
  • Save msgirlperl/8ed865268eca531e8f09950b3a44ee6e to your computer and use it in GitHub Desktop.
Save msgirlperl/8ed865268eca531e8f09950b3a44ee6e to your computer and use it in GitHub Desktop.
#!/bin/bash
isInFile=$(cat tsconfig.json | grep -c "\"noUnusedLocals\": true,")
if [ $isInFile -eq 1 ]; then
#toggle Off
echo 'changing to allow unusedLocals'
sed -i '' 's/"noUnusedLocals": true,/"noUnusedLocals": false,/' tsconfig.json
else
#toggle On
echo 'changing to prevent unusedLocals'
sed -i '' 's/"noUnusedLocals": false,/"noUnusedLocals": true,/' tsconfig.json
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment