Skip to content

Instantly share code, notes, and snippets.

@jamesrr39
jamesrr39 / find-unused-requirejs-imports.sh
Last active August 29, 2015 14:21
Find unused resources
#!/bin/bash
# a script to find any javascripts that may not be used anywhere anymore.
base_directory="."
all_files=$(find "$base_directory" -type f)
for file in $all_files
do
import_name=$(echo "$file" | rev | cut -d "/" -f 1 | rev | sed -e 's/\.js$//')