mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -05:00
add sed -i lint check to ensure portability
This commit is contained in:
parent
dd535a4e32
commit
2990bd0538
3 changed files with 7 additions and 2 deletions
|
@ -5,5 +5,10 @@ if [ -x "$(command -v shellcheck)" ]; then
|
||||||
else
|
else
|
||||||
echo "Warning: shellcheck is not installed, skipping shell scripts"
|
echo "Warning: shellcheck is not installed, skipping shell scripts"
|
||||||
fi
|
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 run lint
|
||||||
"$(yarn bin)/eslint" --rulesdir custom-eslint-rules --ext .ts .
|
"$(yarn bin)/eslint" --rulesdir custom-eslint-rules --ext .ts .
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Replace issue numbers in brackets eg (#1337) with a link to the issue on the repository
|
# 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"
|
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
|
||||||
"$(yarn bin)/marked" "$page" >> "$dest$fileroot.html"
|
"$(yarn bin)/marked" "$page" >> "$dest$fileroot.html"
|
||||||
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$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
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue