Commit c5db0676 authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #305 from heroku/blacklist-lang

test and implementation for blacklisting LANG; fixed failure tests
parents b5d7dfc6 14b6eb0a
......@@ -21,7 +21,7 @@ export_env_dir() {
local env_dir=$1
if [ -d "$env_dir" ]; then
local whitelist_regex=${2:-''}
local blacklist_regex=${3:-'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)$'}
local blacklist_regex=${3:-'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH|LANG)$'}
if [ -d "$env_dir" ]; then
for e in $(ls $env_dir); do
echo "$e" | grep -E "$whitelist_regex" | grep -qvE "$blacklist_regex" &&
......
......@@ -70,13 +70,13 @@ warn_old_npm() {
warn_untracked_dependencies() {
local log_file="$1"
if grep -qi 'gulp: not found' "$log_file"; then
if grep -qi 'gulp: not found' "$log_file" || grep -qi 'gulp: command not found' "$log_file"; then
warning "Gulp may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
fi
if grep -qi 'grunt: not found' "$log_file"; then
if grep -qi 'grunt: not found' "$log_file" || grep -qi 'grunt: command not found' "$log_file"; then
warning "Grunt may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
fi
if grep -qi 'bower: not found' "$log_file"; then
if grep -qi 'bower: not found' "$log_file" || grep -qi 'bower: command not found' "$log_file"; then
warning "Bower may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
fi
}
......
{
"name": "echo-lang",
"version": "1.0.0",
"description": "",
"main": "index.js",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"scripts": {
"postinstall": "echo $LANG; echo $SAFE;"
},
"keywords": [],
"author": "",
"license": "ISC"
}
#!/usr/bin/env bash
# See README.md for info on running these tests.
testEnvBlacklist() {
local cache=$(mktmpdir)
local env_dir=$(mktmpdir)
echo 'tr_TR.UTF-8' > "$env_dir"/LANG
echo 'safeVar' > "$env_dir"/SAFE
compile "echo-lang" $cache $env_dir
assertCaptured "safeVar"
assertNotCaptured "tr_TR.UTF-8"
assertCapturedSuccess
}
testPrePostBuildScripts() {
compile "pre-post-build-scripts"
assertCaptured "Running heroku-prebuild"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment