Created
March 5, 2018 16:33
-
-
Save frederickjh/09ea8fa9cd0f377df2cf0bf26d440167 to your computer and use it in GitHub Desktop.
Fish shell function for generating hash_salt in a file for use with Drupal 8 websites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hashsalt --description 'Generate Drupal 8 hash salt in the current directory in the file, hash_salt.txt. Best to generate in composer project root and ignore in .gitignore. To use this file in settings.php use a line like: $settings[\'hash_salt\'] = file_get_contents(\'../hash_salt.txt\');' | |
drush eval "print_r(Drupal\Component\Utility\Crypt::randomBytesBase64(55))" > hash_salt.txt | |
echo 'hash_salt.txt has been generated. Best to generate in composer project root and ignore in .gitignore. To use this file in settings.php use a line like: $settings[\'hash_salt\'] = file_get_contents(\'../hash_salt.txt\');' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those of you who are new to Fish shell, place this file at:
~/.config/fish/functions/hashsalt.fish