Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter with date #64

Closed
InsOpDe opened this issue Feb 18, 2020 · 3 comments
Closed

Filter with date #64

InsOpDe opened this issue Feb 18, 2020 · 3 comments
Assignees
Labels
done Finished working on the issue enhancement New feature or request

Comments

@InsOpDe
Copy link

InsOpDe commented Feb 18, 2020

Feature Request.
I would save a lot of time if I could automate the process of filtering and deleting the folders. Then I could automate it with my backup plan, i.e. first delete node_modules of old projects, then borgbackup.

Describe the solution you'd like
another parameter which lets you filter (and/or delete) after a given number of days passed since the project has been touched. We could discuss whether the tool should look after the package.json or the youngest file in the node_modules folder (or the youngest file in the parent directory, aka project directory, of the node_modules folder).

You could use it like so:

npkill --filter-days-passed 50

It then shows only all projects which are older than 50 days

Describe alternatives you've considered
using find ..

@zaldih zaldih added the enhancement New feature or request label Mar 28, 2020
@zaldih
Copy link
Member

zaldih commented Mar 31, 2020

Hi! Thanks for opening this issue.

Yeah! It’s a great idea. It’s actually a pending TODO (you can see it on the README.) It hasn’t yet been incorporated due to the ‘technical difficulty’ that you yourself mention.

Just as you said, calculating the last modification in the node_modules file isn’t enough, we have to analyse the rest of the project’s files, since this is what will really let us know how long it’s been since it was last worked on.
Analysing each of a project’s files to obtain the last modification date is simpler in linux (can be done with find), but requires a little more work in windows os. Currently, the windows logic is written in go (files.service.go).

We’ve detailed the process here in case someone reads this and would like to start working on this :)

@zaldih zaldih added the help wanted Extra attention is needed label Sep 24, 2022
@zaldih zaldih pinned this issue Sep 24, 2022
@zaldih
Copy link
Member

zaldih commented Oct 10, 2022

I'm working on the feature of add "last working date of the project" atribute to results so when it is ready, this issue will be able to continue going forward

@zaldih zaldih removed the help wanted Extra attention is needed label Oct 18, 2022
@zaldih zaldih self-assigned this Oct 18, 2022
@zaldih zaldih added the in progress Working on resolving the issue label Oct 18, 2022
@zaldih
Copy link
Member

zaldih commented Nov 1, 2022

Hey!
What do you think should be named the parameter to filter by 'date/old'?

--sort date
--sort old

@zaldih zaldih added done Finished working on the issue and removed in progress Working on resolving the issue labels Nov 7, 2022
@zaldih zaldih closed this as completed Nov 7, 2022
@zaldih zaldih unpinned this issue Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Finished working on the issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants