Skip to content

Commit 33306cd

Browse files
committed
feat: always glob root file
1 parent 6fcbaff commit 33306cd

4 files changed

Lines changed: 22 additions & 42 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,26 @@ jobs:
4444
with:
4545
texlive_version: ${{ matrix.texlive_version }}
4646
root_file: "glob_test*.tex"
47-
glob_root_file: true
4847
working_directory: test/
4948
- name: Compile multiple LaTeX documents in different directories
5049
uses: ./
5150
with:
5251
texlive_version: ${{ matrix.texlive_version }}
5352
root_file: "subdir*/main.tex"
54-
glob_root_file: true
5553
working_directory: test/
5654
work_in_root_file_dir: true
5755
- name: Compile multiple LaTeX documents in different directories using extended glob
5856
uses: ./
5957
with:
6058
texlive_version: ${{ matrix.texlive_version }}
6159
root_file: "extglob/!(subdir3)_glob/*.tex"
62-
glob_root_file: true
6360
working_directory: test/
6461
work_in_root_file_dir: true
6562
- name: Compile multiple LaTeX documents in different directories using glob star
6663
uses: ./
6764
with:
6865
texlive_version: ${{ matrix.texlive_version }}
6966
root_file: "globstar/**/*.tex"
70-
glob_root_file: true
7167
working_directory: test/
7268
work_in_root_file_dir: true
7369
- name: Compile LaTeX document with math symbols

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Each input is provided as a key inside the `with` section of the action.
1414

1515
* `root_file`
1616

17-
The root LaTeX file to be compiled. This input is required. You can also pass multiple files as a multi-line string to compile multiple documents. For example:
17+
The root LaTeX file to be compiled. This input is required. You can also pass multiple files as a multi-line string to compile multiple documents. Each file path will be interpreted as bash glob pattern. For example:
1818
```yaml
1919
- uses: xu-cheng/latex-action@v3
2020
with:
@@ -23,16 +23,6 @@ Each input is provided as a key inside the `with` section of the action.
2323
file2.tex
2424
```
2525
26-
* `glob_root_file`
27-
28-
If set, interpret the `root_file` input as bash glob pattern. For example:
29-
```yaml
30-
- uses: xu-cheng/latex-action@v3
31-
with:
32-
root_file: "*.tex"
33-
glob_root_file: true
34-
```
35-
3626
* `working_directory`
3727

3828
The working directory for this action.
@@ -59,7 +49,7 @@ Each input is provided as a key inside the `with` section of the action.
5949

6050
* `extra_fonts`
6151

62-
Install extra `.ttf`/`.otf` fonts to be used by `fontspec`. You can also pass multiple files as a multi-line string. Each file path will be interpreted as glob pattern. For example:
52+
Install extra `.ttf`/`.otf` fonts to be used by `fontspec`. You can also pass multiple files as a multi-line string. Each file path will be interpreted as bash glob pattern. For example:
6353
```yaml
6454
- uses: xu-cheng/latex-action@v3
6555
with:

action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ inputs:
99
root_file:
1010
description: The root LaTeX file to be compiled
1111
required: true
12-
glob_root_file:
13-
description: Interpret the root_file input as bash glob pattern
1412
working_directory:
1513
description: The working directory for this action
1614
work_in_root_file_dir:
@@ -49,7 +47,6 @@ runs:
4947
"${{ inputs.texlive_version }}" \
5048
"${{ inputs.docker_image }}" \
5149
"${{ inputs.root_file }}" \
52-
"${{ inputs.glob_root_file }}" \
5350
"${{ inputs.working_directory }}" \
5451
"${{ inputs.work_in_root_file_dir }}" \
5552
"${{ inputs.continue_on_error }}" \

entrypoint.sh

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@ error() {
1717
}
1818

1919
root_file="${1}"
20-
glob_root_file="${2}"
21-
working_directory="${3}"
22-
work_in_root_file_dir="${4}"
23-
continue_on_error="${5}"
24-
compiler="${6}"
25-
args="${7}"
26-
extra_packages="${8}"
27-
extra_system_packages="${9}"
28-
extra_fonts="${10}"
29-
pre_compile="${11}"
30-
post_compile="${12}"
31-
latexmk_shell_escape="${13}"
32-
latexmk_use_lualatex="${14}"
33-
latexmk_use_xelatex="${15}"
20+
working_directory="${2}"
21+
work_in_root_file_dir="${3}"
22+
continue_on_error="${4}"
23+
compiler="${5}"
24+
args="${6}"
25+
extra_packages="${7}"
26+
extra_system_packages="${8}"
27+
extra_fonts="${9}"
28+
pre_compile="${10}"
29+
post_compile="${11}"
30+
latexmk_shell_escape="${12}"
31+
latexmk_use_lualatex="${13}"
32+
latexmk_use_xelatex="${14}"
3433

3534
# install git on old images
3635
if ! command -v git &>/dev/null; then
@@ -51,15 +50,13 @@ if [[ -n "$working_directory" ]]; then
5150
cd "$working_directory"
5251
fi
5352

54-
if [[ -n "$glob_root_file" ]]; then
55-
expanded_root_file=()
56-
for pattern in "${root_file[@]}"; do
57-
# shellcheck disable=SC2206
58-
expanded=( $pattern )
59-
expanded_root_file+=("${expanded[@]}")
60-
done
61-
root_file=("${expanded_root_file[@]}")
62-
fi
53+
expanded_root_file=()
54+
for pattern in "${root_file[@]}"; do
55+
# shellcheck disable=SC2206
56+
expanded=( $pattern )
57+
expanded_root_file+=("${expanded[@]}")
58+
done
59+
root_file=("${expanded_root_file[@]}")
6360

6461
if [[ -z "$compiler" && -z "$args" ]]; then
6562
warn "Input 'compiler' and 'args' are both empty. Reset them to default values."

0 commit comments

Comments
 (0)