Skip to content
Snippets Groups Projects
Commit 7223b44e authored by Jan Frenzel's avatar Jan Frenzel
Browse files

Removed two unnecessary uses of cat in check-code-style.sh.

parent 915d66d8
No related branches found
No related tags found
2 merge requests!673Automated merge from preview to main,!655Resolve "Lint test scripts in doc.zih.tu-dresden.de/util"
......@@ -60,13 +60,10 @@ function style_check() {
elif [[ "${ext}" == "md" ]]; then
# If markdown file is provided
# Check if the code snippet exists in the markdown file
local test_string_exit_code
test_string_exit_code=$(cat $myfile | sed -n '/^```bash$/,/^```$/p' | grep -qv '```'; echo $? | tail -1)
if [[ "${test_string_exit_code}" == "0" ]]; then
if sed -n '/^```bash$/,/^```$/p' $myfile | grep -qv '```'; then
# Extracting code snippet within ```bash ... ```
local test_string
test_string=$(cat $myfile | sed -n '/^```bash$/,/^```$/p' | grep -v '```')
test_string=$(sed -n '/^```bash$/,/^```$/p' $myfile | grep -v '```')
# Check the exit code of pattern match
if echo "${test_string}" | grep -qP "${pattern}"; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment