Idier: Make your projects folder tidier
Idier is a tool that moves top-level folders into a specially named folder called
_Archive if the files in those folders have not been modified recently.
This tool is meant to automatically tidy up your "projects folder": that bucket of folders probably everyone has. Perhaps you produce music and have a folder with all of your song projects. Or a coder with lots of git repos. Or folders for each of your graphic design clients. Using this tool will reduce the clutter and decision making process.
How Does It Work?
Given a root folder (defaults to current working directory), look at all the files and their relative mtimes (days since last modified). Group them all into top-level folders, taking the newest mtime of all the children per folder. If the newest relative mtime is more than the configured number of days (defaults to 180 days), then move the folder into the configured archive folder (defaults to
_Archive). It ignores bare files without a folder, as well as some typical non-user files, like
An example is probably better than words:
$ lsdrwxr-xr-x 16 drew staff 512B Jan 8 23:14 .drwxr-xr-x+ 138 drew staff 4.3K Jan 4 23:33 ..-rw-r--r--@ 1 drew staff 22K Jan 8 23:03 .DS_Storedrwxr-xr-x 161 drew staff 5.0K Jan 8 23:14 _Archivedrwxr-xr-x 14 drew staff 448B May 12 2019 project01drwxr-xr-x 17 drew staff 544B Jul 14 23:10 project02drwxr-xr-x 19 drew staff 608B Oct 5 20:09 project03drwxr-xr-x 13 drew staff 416B Oct 17 2010 project04drwxr-xr-x@ 14 drew staff 448B Jul 24 21:33 project05drwxr-xr-x@ 18 drew staff 576B Sep 2 19:45 project06drwxr-xr-x 14 drew staff 448B Jan 3 00:18 project07drwxr-xr-x 9 drew staff 288B Jan 4 17:19 project08drwxr-xr-x@ 26 drew staff 832B Oct 27 16:59 project09drwxr-xr-x 14 drew staff 448B Jan 7 02:23 project10
$ npx @kirbysayshi/idier Analyzed 1221 files in 10 projects in 00m00s150ms Projects untouched for more than 180 days: project01 (241 days ago) -> WILL ARCHIVE Archive above projects? y/N: y moving /Users/drew/Projects/project01 -> /Users/drew/Projects/_Archive/project01
By default, an "untouched" project is one unmodified for more than 180 days. This is configurable, along with other options:
$ npx @kirbysayshi/idieridier: Move projects untouched
Contributing / Development
This project uses @spotify/web-scripts for build, test, lint, auto-format, and release.
yarn commit so that semantic-release knows when to release during master builds!