Skip to content

Commit cda8264

Browse files
committed
🐚 Adds submodule option for jekyll-build
1 parent 3a1435b commit cda8264

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ tee -a /etc/shells 1>/dev/null <<<"$(which git-shell)"
6060

6161
```Bash
6262
adduser\
63-
--force-badname\
6463
--system\
6564
--disabled-password\
6665
--gecos ''\

jekyll-build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ usage(){
3434
# Name of repository to run
3535
# bundle exec jekyll build --destination "${_srv_path//${HOME}/~}"
3636
#
37+
# -s --submodules
38+
# Runs: git submodule update --init --recursive --merge
39+
#
3740
# -l --license
38-
# Shows script or project license then exits
41+
# Shows script or project license then exits
3942
#
4043
# -h --help help
4144
# Displays this message and exits
@@ -47,6 +50,7 @@ EOF
4750

4851
_args=("${@:?# No arguments provided try: ${__NAME__} help}")
4952
_valid_args=('--help|-h|help:bool'
53+
'--submodules|-s|submodules:bool'
5054
'--license|-l|license:bool'
5155
'--repo-name:posix-nil')
5256
argument_parser '_args' '_valid_args'
@@ -96,10 +100,15 @@ done < <(ls -1 "${_git_path}"/_config*.y*ml)
96100

97101
[[ -d "${_www}" ]] || mkdir -vp "${_www}"
98102

103+
99104
_pwd="${PWD}"
100105
cd "${_git_path}"
101-
source "${HOME}/.bash_aliases"
106+
if ((_submodules)); then
107+
git submodule update --init --recursive --merge
108+
fi
109+
102110

111+
source "${HOME}/.bash_aliases"
103112
## Use API keys if configured for repo and available to user during build process
104113
if grep -q -- 'jekyll-github-metadata' "${_git_path}/Gemfile" && [ -f "${_github_api_token_path}" ]; then
105114
printf '# JEKYLL_GITHUB_TOKEN="$(<github-api-token-path)" bundle exec jekyll build --destination %s --config %s\n' "${_srv_path}" "${_config_files}"

jekyll-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ cat >> "${_git_path}/.gitignore" <<EOF
213213
Bundler
214214
vendor
215215
.bundle
216-
Gemfile.lock
216+
node_modules
217217
EOF
218218

219219
git_add_commit 'Added files from Bundler & Jekyll to git tracking'

0 commit comments

Comments
 (0)