Skip to content

Instantly share code, notes, and snippets.

@hbouhadji
Last active February 12, 2021 12:58
Show Gist options
  • Save hbouhadji/92e84e68e7d6145e7ad3d67c199add77 to your computer and use it in GitHub Desktop.
Save hbouhadji/92e84e68e7d6145e7ad3d67c199add77 to your computer and use it in GitHub Desktop.
Fill environment properties on beanstalk from .env file
// example in the body
// paste it in the chrome console
let raw = `
APP_NAME=Laravel
APP_ENV=local
`;
raw = raw.split('\n').filter(str => str.length > 0 && str[0] != '#')
raw.forEach(keyValue => {
keyValue = keyValue.split('=');
let last = $('table.properties-table').find('tr[class="ng-scope"]').last();
let keyInput = last.find('input')[0];
let valueInput = last.find('input')[1];
keyInput.value = keyValue[0];
valueInput.value = keyValue[1];
angular.element(keyInput).triggerHandler('change');
angular.element(valueInput).triggerHandler('change');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment