Skip to content

Commit cac23b3

Browse files
committed
used sed instead
1 parent d89a3df commit cac23b3

3 files changed

Lines changed: 39 additions & 22 deletions

File tree

COMMENT.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<!-- The README.md file was assembled using pandoc from the files listed in
2-
"files.txt". See the script in "generateREADME.sh". Do not modify README.md.
3-
Instead, modify the files listed in "files.txt", or add a new file to the list
4-
in "files.txt". -->
1+
<!--
2+
WARNING: DO NOT MODIFY DIRECTLY THE README.md!
3+
This README.md file was assembled using the sed command from the files listed in
4+
"files.txt". See the script in "generateREADME.sh". To modify the content of
5+
the README.md, modify the files listed in
6+
"files.txt", or add a new file to the list in "files.txt".
7+
-->

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
```{=html}
2-
<!-- The README.md file was assembled using pandoc from the files listed in
3-
"files.txt". See the script in "generateREADME.sh". Do not modify README.md.
4-
Instead, modify the files listed in "files.txt", or add a new file to the list
5-
in "files.txt". -->
6-
```
1+
<!--
2+
WARNING: DO NOT MODIFY DIRECTLY THE README.md!
3+
This README.md file was assembled using the sed command from the files listed in
4+
"files.txt". See the script in "generateREADME.sh". To modify the content of
5+
the README.md, modify the files listed in
6+
"files.txt", or add a new file to the list in "files.txt".
7+
-->
8+
79
# LAMMPS tutorials' special repository
810

9-
This repository contains the list of [authors](AUTHORS.md) from the
10-
LAMMPS tutorials initiative.
11+
This repository contains the list of [authors](AUTHORS.md) from the LAMMPS tutorials
12+
initiative.
1113

12-
The content of the profile/README.md appears on the GitHub profile of
13-
the [LAMMPS tutorials organization](https://github.com/lammpstutorials).
14+
The content of the profile/README.md appears on the GitHub profile of the
15+
[LAMMPS tutorials organization](https://github.com/lammpstutorials).
1416

1517
## Authors
1618

1719
### Project creator
1820

19-
[Simon Gravelle](https://github.com/simongravelle), University Grenoble
20-
Alpes, CNRS, LIPhy, Grenoble, 38000, France
21+
[Simon Gravelle](https://github.com/simongravelle), University Grenoble Alpes, CNRS, LIPhy, Grenoble, 38000, France
2122

2223
### Contributors
2324

24-
- [Jacob R. Gissinger](https://www.stevens.edu/profile/jgissing),
25-
Stevens Institute of Technology, Hoboken, NJ 07030, USA
26-
- [Axel Kohlmeyer](https://sites.google.com/site/akohlmey), Institute
27-
for Computational Molecular Science, Temple University,
28-
Philadelphia, PA 19122, USA
25+
- [Jacob R. Gissinger](https://www.stevens.edu/profile/jgissing), Stevens Institute of Technology, Hoboken, NJ 07030, USA
26+
- [Axel Kohlmeyer](https://sites.google.com/site/akohlmey), Institute for Computational Molecular Science, Temple University, Philadelphia, PA 19122, USA
27+
28+

generateREADME.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
#!/bin/bash
22

3+
output_file="README.md"
4+
> "$output_file"
5+
36
files=()
47
while IFS= read -r line; do
58
files+=("$line")
69
done < "files.txt"
710
input_files="${files[@]}"
811

9-
pandoc -s $input_files -o README.md
12+
# Loop through each file and append its content to the output file
13+
for file in "${files[@]}"; do
14+
# Check if file exists before attempting to read it
15+
if [ -f "$file" ]; then
16+
# Append file content to the output file
17+
cat "$file" >> "$output_file"
18+
# Append a blank line after each file's content
19+
echo -e "\n" >> "$output_file"
20+
else
21+
echo "Warning: File '$file' does not exist."
22+
fi
23+
done

0 commit comments

Comments
 (0)