diff options
author | isaacs <i@izs.me> | 2011-12-15 04:20:50 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-12-15 04:20:50 +0400 |
commit | 1c245046b649a5e5bee45a793002c85839cbe8a1 (patch) | |
tree | e8fb85af515128f8e9dd2e6947f281457c4aafb8 /test | |
parent | 8731fef0f88617cccc856692f352f7228461a69e (diff) |
Bring npmignore behavior more into line with gitignore
Diffstat (limited to 'test')
-rw-r--r-- | test/packages/npm-test-ignore/.npmignore | 7 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/ignore3 | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/ignoredir1/a | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/ignoredir2/a | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/include4 | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/package.json | 3 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/sub/ignore1 | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/sub/ignore3 | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/sub/include | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/sub/include2 | 0 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/sub/include4 | 1 | ||||
-rw-r--r-- | test/packages/npm-test-ignore/test.sh | 27 |
12 files changed, 38 insertions, 0 deletions
diff --git a/test/packages/npm-test-ignore/.npmignore b/test/packages/npm-test-ignore/.npmignore new file mode 100644 index 000000000..c7d927d0a --- /dev/null +++ b/test/packages/npm-test-ignore/.npmignore @@ -0,0 +1,7 @@ +/sub/ignore1 +./sub/include2 +ignore3 +./include4 +ignoredir1 +ignoredir2/ +*.tgz diff --git a/test/packages/npm-test-ignore/ignore3 b/test/packages/npm-test-ignore/ignore3 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/ignore3 diff --git a/test/packages/npm-test-ignore/ignoredir1/a b/test/packages/npm-test-ignore/ignoredir1/a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/ignoredir1/a diff --git a/test/packages/npm-test-ignore/ignoredir2/a b/test/packages/npm-test-ignore/ignoredir2/a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/ignoredir2/a diff --git a/test/packages/npm-test-ignore/include4 b/test/packages/npm-test-ignore/include4 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/include4 diff --git a/test/packages/npm-test-ignore/package.json b/test/packages/npm-test-ignore/package.json new file mode 100644 index 000000000..6d492de78 --- /dev/null +++ b/test/packages/npm-test-ignore/package.json @@ -0,0 +1,3 @@ +{ "name":"npm-test-ignore" +, "version":"1.2.5" +, "scripts":{"test":"bash test.sh"}} diff --git a/test/packages/npm-test-ignore/sub/ignore1 b/test/packages/npm-test-ignore/sub/ignore1 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/sub/ignore1 diff --git a/test/packages/npm-test-ignore/sub/ignore3 b/test/packages/npm-test-ignore/sub/ignore3 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/sub/ignore3 diff --git a/test/packages/npm-test-ignore/sub/include b/test/packages/npm-test-ignore/sub/include new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/sub/include diff --git a/test/packages/npm-test-ignore/sub/include2 b/test/packages/npm-test-ignore/sub/include2 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/packages/npm-test-ignore/sub/include2 diff --git a/test/packages/npm-test-ignore/sub/include4 b/test/packages/npm-test-ignore/sub/include4 new file mode 100644 index 000000000..d16969cd1 --- /dev/null +++ b/test/packages/npm-test-ignore/sub/include4 @@ -0,0 +1 @@ +This file should be in the package. diff --git a/test/packages/npm-test-ignore/test.sh b/test/packages/npm-test-ignore/test.sh new file mode 100644 index 000000000..cdf47f211 --- /dev/null +++ b/test/packages/npm-test-ignore/test.sh @@ -0,0 +1,27 @@ +x=`find . | grep ignore | grep -v npmignore` +if [ "$x" != "" ]; then + echo "ignored files included: $x" + exit 1 +fi + +x=`find . | grep -v ignore | sort` +y=". +./include4 +./package.json +./sub +./sub/include +./sub/include2 +./sub/include4 +./test.sh" +if [ "$x" != "$y" ]; then + echo "missing included files" + echo "got:" + echo "===" + echo "$x" + echo "===" + echo "wanted:" + echo "===" + echo "$y" + echo "===" + exit 1 +fi |