This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make the script fail on the first error encountered. | |
set -euo pipefail | |
# Create a temp folder that we can use to store files in. | |
if [ "$(uname -s)" = "Darwin" ]; then | |
tmp_dir=$(mktemp -d -t find-dead-modules.XXXXXXXX) | |
else | |
tmp_dir=$(mktemp -d --tmpdir find-dead-modules.XXXXXXXX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Converts global chained `var`s into single-line vars. | |
# | |
# Example: | |
# | |
# >> cat app/assets/javascripts/test.js | |
# var A = require('a'), | |
# B = require('b'), | |
# C = B.C; | |
# | |
# var D = function() {}; |