Welcome to mirror list, hosted at ThFree Co, Russian Federation.

run-stylelint.sh « scripts - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ec8c7c18f9e196e8c10904be1cb6b4ff25cd4fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

STYLESHEETS="content/assets/stylesheets/*.scss"
MIXINS_STYLESHEETS="content/assets/stylesheets/mixins/*.scss"
ALL_STYLESHEETS="content/assets/stylesheets/*.scss content/assets/stylesheets/mixins/*.scss"

# Preseve original content in temporary files and then strip YAML frontmatter from stylesheets
for stylesheet in $ALL_STYLESHEETS; do
  cp "$stylesheet" "$stylesheet-tmp"
  tail -n +5 "$stylesheet-tmp" > "$stylesheet"
done

yarn stylelint "$STYLESHEETS"
yarn stylelint "$MIXINS_STYLESHEETS"

# Restore original contents of stylesheets
for stylesheet in $ALL_STYLESHEETS; do
  mv "$stylesheet-tmp" "$stylesheet"
done