diff options
author | Rebecca Turner <me@re-becca.org> | 2018-06-07 21:18:40 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-06-08 05:26:32 +0300 |
commit | f456fca290a20cec4c465537f67030d1542d185a (patch) | |
tree | dda8e20fc95ba68e396162f32602446fa3688950 /scripts | |
parent | f722029441a088d03df94bdfdeeec51cfd318659 (diff) |
scripts: auto generate ignores
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dep-update | 3 | ||||
-rwxr-xr-x | scripts/dev-dep-update | 1 | ||||
-rw-r--r-- | scripts/gen-dev-ignores.js | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/scripts/dep-update b/scripts/dep-update index ec799b128..52abd518c 100755 --- a/scripts/dep-update +++ b/scripts/dep-update @@ -1,6 +1,7 @@ #!/bin/bash node . install --save $1@$2 &&\ -git add node_modules/$1/ package.json package-lock.json &&\ +node scripts/gen-dev-ignores.js &&\ +git add node_modules package.json package-lock.json &&\ git commit -m"$1@$2" &&\ node . repo $1 &&\ git commit --amend diff --git a/scripts/dev-dep-update b/scripts/dev-dep-update index 572f1c39c..c8c960475 100755 --- a/scripts/dev-dep-update +++ b/scripts/dev-dep-update @@ -1,5 +1,6 @@ #!/bin/bash node . install --save --save-dev $1@$2 &&\ +node scripts/gen-dev-ignores.js &&\ git add package.json package-lock.json &&\ git commit -m"$1@$2" &&\ node . repo $1 &&\ diff --git a/scripts/gen-dev-ignores.js b/scripts/gen-dev-ignores.js new file mode 100644 index 000000000..3f6dcb301 --- /dev/null +++ b/scripts/gen-dev-ignores.js @@ -0,0 +1,5 @@ +const fs = require('fs') +const plock = require('../package-lock.json') +fs.writeFileSync(`${__dirname}/../node_modules/.gitignore`, + '## Automatically generated dev dependency ignores\n' + + Object.keys(plock.dependencies).filter(_ => plock.dependencies[_].dev).map(_ => `/${_}`).join('\n') + '\n') |