2017-10-31 11:01:53 +00:00
|
|
|
#!/bin/bash
|
2018-12-30 12:44:08 +00:00
|
|
|
set -euo pipefail
|
2017-10-31 11:01:53 +00:00
|
|
|
|
2019-02-28 18:51:33 +00:00
|
|
|
version="19af63af"
|
|
|
|
source="https://raw.githubusercontent.com/leonardr/olipy/${version}/olipy/data/corpora-olipy/words/scribblenauts.json"
|
2017-10-31 11:01:53 +00:00
|
|
|
|
2019-02-28 18:51:33 +00:00
|
|
|
words=$(curl -sL "${source}" | jq -r '.nouns | .[]' | sort | awk '/^[a-z]{4}[a-z]*$/{ print "\""$1"\"," }')
|
2017-10-31 11:01:53 +00:00
|
|
|
|
2018-12-30 12:44:08 +00:00
|
|
|
cat -s <<EOF >lib/xkcd_words.go
|
2017-10-31 11:01:53 +00:00
|
|
|
package securepassword
|
|
|
|
|
|
|
|
// xkcdWordList contains a list of words derived from the scribblenauts
|
|
|
|
// word list inside the olipy library by leonardr
|
|
|
|
// https://github.com/leonardr/olipy
|
|
|
|
var xkcdWordList = []string{
|
2018-12-30 12:44:08 +00:00
|
|
|
${words}
|
2017-10-31 11:01:53 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
gofmt -s -w lib/xkcd_words.go
|