mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -05:00
Merge pull request #4892 from chrishollandaise/sed-portable-lint
Add additional sh lint check for incompatible sed -i cases
This commit is contained in:
commit
d59a9d96bb
3 changed files with 7 additions and 2 deletions
|
@ -5,5 +5,10 @@ if [ -x "$(command -v shellcheck)" ]; then
|
|||
else
|
||||
echo "Warning: shellcheck is not installed, skipping shell scripts"
|
||||
fi
|
||||
incompatible_sed=$(! grep -RPn --color=always --exclude-dir=node_modules --exclude-dir=.git 'sed(?:\s-\w+)*\s-i(?!\S|\s"")')
|
||||
if [ "$incompatible_sed" ]; then
|
||||
printf "\nWarning: avoid non-portable sed flag -i without backup extension, use -i.bak\n"
|
||||
printf "%s\n\n" "$incompatible_sed"
|
||||
fi
|
||||
yarn run lint
|
||||
"$(yarn bin)/eslint" --rulesdir custom-eslint-rules --ext .ts .
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Replace issue numbers in brackets eg (#1337) with a link to the issue on the repository
|
||||
sed -i 's; (#\([0-9]*\)); ([#\1](https://github.com/tridactyl/tridactyl/issues/\1));g' CHANGELOG.md
|
||||
sed -i.bak 's; (#\([0-9]*\)); ([#\1](https://github.com/tridactyl/tridactyl/issues/\1));g' CHANGELOG.md
|
||||
|
|
|
@ -16,5 +16,5 @@ do
|
|||
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
|
||||
"$(yarn bin)/marked" "$page" >> "$dest$fileroot.html"
|
||||
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
|
||||
sed -i "s|\.md|.html|g" "$dest$fileroot.html"
|
||||
sed -i.bak "s|\.md|.html|g" "$dest$fileroot.html"
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue