duan602728596 / node-modules-clean

清除node_modules文件夹内的冗余文件。
MIT License
4 stars 0 forks source link

Add option for load files-for-remove from external file #1

Open KarelWintersky opened 6 years ago

KarelWintersky commented 6 years ago

in addition to -f flag

duan602728596 commented 6 years ago

Do you mean not only delete the files in the node_modules folder?

KarelWintersky commented 6 years ago

You package removes only README.md My command now is: node-clean-modules --file "AUTHORS|tst|README.markdown|.travis.yml|Makefile|LICENCE|LICENSE.BSD|LICENSE.source-map|LICENSE-MIT|ChangeLog|.jshintrc|.babelrc|.eslintrc|.jscs.json"

too long to remember

KarelWintersky commented 6 years ago

And, you package don't remove files, that declared in -f flag as *.md or *.html :(

duan602728596 commented 6 years ago

Are you using cmd or powerShell? When using powerShell, it will have an error. When using cmd, he is good. When you want to delete a type of document, it should be used:node-modules-clean --ext ".md | .html". You can also configure the scripts command in package.json and use the npm run command.

KarelWintersky commented 6 years ago

I using gentoo and zsh.

duan602728596 commented 6 years ago

Can you give me a screenshot? I do not have linux system environment.

KarelWintersky commented 6 years ago

Screenshot with WHAT? Work output?

duan602728596 commented 6 years ago

Yes,because I do not have linux environment, so I would like to see what is the problem after the command is run.

KarelWintersky commented 6 years ago

I mean that: please add to you script ability to load list of files, that must be removed from file. like:

node-modules-clean --filelist files.txt

Any file must be in new line:

AUTHORS
README.*
.travis.yml
LICENSE.*
.jshintrc
<and so on>

It is possible to create required command directly from console using bash, but it's not comfortable for use.

KarelWintersky commented 6 years ago

I would like to see what is the problem after the command is run.

if command is correct - output is empty (if files not found) OR list of removed files

DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/wordwrap\README.markdown
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/wrappy\LICENSE
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/which\README.md
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/ws\LICENSE
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/wrappy\README.md
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/xml-name-validator\LICENSE.txt
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/ws\README.md
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/xml-name-validator\README.md
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/wordwrap/test\idleness.txt
KarelWintersky commented 6 years ago
 node-modules-clean --file "README.*|LICENSE.*"

result

DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/xtend\.npmignore
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/xtend\README.md
DELETE: /srv/shared/archives/.WebVHosts/rpgclubs_rf.towers.local/node_modules/wordwrap/test\idleness.txt

but /wordwrap/README.markdown NOT removed

KarelWintersky commented 6 years ago
total 36
drwxr-xr-x   4 arris arris  4096 Feb  7 14:01 .
drwxr-xr-x 218 arris arris 12288 Feb  7 14:00 ..
drwxr-xr-x   2 arris arris  4096 Feb  7 14:00 example
-rw-r--r--   1 arris arris  2231 May  7  2015 index.js
-rw-r--r--   1 arris arris  2333 Feb  7 14:00 package.json
-rw-r--r--   1 arris arris  1827 May  7  2015 README.markdown
drwxr-xr-x   2 arris arris  4096 Feb  7 14:01 test
duan602728596 commented 6 years ago

I understand, I will add this feature, and solve this problem.

KarelWintersky commented 6 years ago

Wrote about it, ok? ;-)

duan602728596 commented 6 years ago

I have updated, you can download a new try.

KarelWintersky commented 6 years ago

nice! Last change: add -h | --help key with a bit info about keys, functions and copyrights.

duan602728596 commented 6 years ago

Ha ha ha, can help you is very good. The help command is the default, I will change.

KarelWintersky commented 6 years ago

I make world better :)

duan602728596 commented 6 years ago

Thank you! :)