Skip to content

Instantly share code, notes, and snippets.

View IrenaYuan's full-sized avatar

Irena IrenaYuan

  • Taipei, Taiwan
View GitHub Profile
@IrenaYuan
IrenaYuan / find-unused-sass-variables.sh
Last active September 7, 2017 06:08 — forked from badsyntax/find-unused-sass-variables.sh
Find unused SCSS variables. Usage: `./find-unused-sass-variables.sh sassDir/`
#!/usr/bin/env bash
#
# Approach:
# 1. Find variable declaration in the form of "$my-var: anyvalue"
# 2. Loop through found variables and find occurrences of each variable in all sass files
# 3. Filter out vars that occurred only once
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1