Make ask_pn() more friendly
This commit is contained in:
@@ -226,13 +226,30 @@ err() { echo "Error: $*" >&2; }
|
||||
ask_pn() {
|
||||
unset PROJECT
|
||||
declare -g PROJECT
|
||||
word1=$(shuf -n 1 /usr/share/dict/words)
|
||||
word2=$(shuf -n 1 /usr/share/dict/words)
|
||||
word3=$(shuf -n 1 /usr/share/dict/words)
|
||||
read -r -p "Enter a new or existing project name, ex. ${PROJECT_PREFIX}_${word1}_${word2}_${word3}: " PROJECT
|
||||
cat <<-EOF
|
||||
Enter a new or existing project name, ex. ${PROJECT_PREFIX}_$(random_words 3)
|
||||
If entering a new project, use the suggested prefix: ${PROJECT_PREFIX}_
|
||||
You may choose any combination of words/characters following the prefix, but be sensible.
|
||||
Make it descriptive and avoid spaces and special characters.
|
||||
EOF
|
||||
read -r -p "Enter a new or existing project name: " PROJECT
|
||||
[[ -z $PROJECT ]]
|
||||
}
|
||||
debug() { (( DEBUG )) && echo "Debug: $*"; }
|
||||
# Not super portable but nice to have
|
||||
random_words() {
|
||||
local num=${1:-2}
|
||||
local -a arr
|
||||
for ((i=0;i<num;i++)); do
|
||||
word=$(shuf -n1 /usr/share/dict/words | sed -e 's/-//g' -e 's/_//g')
|
||||
# Sanitize
|
||||
word="${word//-/}"
|
||||
word="${word//_/}"
|
||||
word="${word,,}"
|
||||
arr+=("$word")
|
||||
done
|
||||
printf "%s_" "${arr[@]}" | sed 's/_$//'
|
||||
}
|
||||
|
||||
|
||||
# @section Modules
|
||||
@@ -244,7 +261,6 @@ debug() { (( DEBUG )) && echo "Debug: $*"; }
|
||||
# * Dictating the ordering of multiple submodules
|
||||
# * Modules should competently handle pushd and popd for their submodules if they do not reside in the SCANS/PROJECT_DIR
|
||||
|
||||
|
||||
module install_dependencies
|
||||
# @section Install dependencies
|
||||
# @description Installs dependencies for the workflow
|
||||
@@ -278,9 +294,9 @@ install_dependencies() {
|
||||
debug "Running: ${FUNCNAME[0]}" "$@"
|
||||
|
||||
# Dependency arrays
|
||||
depends_rpm=(graphviz pandoc pdftk-java gd-devel shdoc nano rsync)
|
||||
depends_deb=(graphviz pandoc pdftk-java libgd-dev shdoc nano rsync)
|
||||
depends_brew=(graphiz pandoc gd pdftk-java shdoc nano rsync)
|
||||
depends_rpm=(graphviz pandoc pdftk-java gd-devel shdoc nano rsync coreutils)
|
||||
depends_deb=(graphviz pandoc pdftk-java libgd-dev shdoc nano rsync coreutils)
|
||||
depends_brew=(graphiz pandoc gd pdftk-java shdoc nano rsync coreutils)
|
||||
depends_perl=(File::Map ExtUtils::PkgConfig GD GO::TermFinder)
|
||||
depends_r=(BiocManager ontologyIndex ggrepel tidyverse sos openxlsx ggplot2
|
||||
plyr extrafont gridExtra gplots stringr plotly ggthemes pandoc rmarkdown
|
||||
|
||||
Reference in New Issue
Block a user