Skip to content

Instantly share code, notes, and snippets.

@sk22
Last active October 3, 2018 21:03
Show Gist options
  • Save sk22/ed7bd22866345d6735ef24c0bf9ef731 to your computer and use it in GitHub Desktop.
Save sk22/ed7bd22866345d6735ef24c0bf9ef731 to your computer and use it in GitHub Desktop.
Imagine Spotify had an npm-like download manager...
$ sdm add album Green Day - Revolution Radio
sdm add v0.1.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 11 new dependencies.
info Direct dependencies
└─ album "Green Day - Revolution Radio"
info All dependencies
├─ song "Green Day - Somewhere Now"
├─ song "Green Day - Bang Bang"
├─ song "Green Day - Revolution Radio"
├─ song "Green Day - Say Goodbye"
├─ song "Green Day - Outlaws"
├─ song "Green Day - Bouncing Off the Wall"
├─ song "Green Day - Still Breathing"
├─ song "Green Day - Youngblood"
├─ song "Green Day - Too Dumb to Die"
├─ song "Green Day - Troubled Times"
├─ song "Green Day - Forever Now"
└─ song "Green Day - Ordinary World"

$ sdm why song Green Day - Still Breathing
sdm why v0.1.0
[1/4] Why do we have the song "Green Day - Still Breathing"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found song "Green Day - Still Breathing"
info Reasons this song exists
   - Album "Green Day - Revolution Radio" depends on it

$ sdm add song Green Day - Still Breathing
sdm add v0.1.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 0 new dependencies.

$ sdm why song Green Day - Still Breathing
sdm why v0.1.0
[1/4] Why do we have the song "Green Day - Still Breathing"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found song "Green Day - Still Breathing"
info Reasons this song exists
   - Specified in "dependencies"
   - Hoisted from "Green Day - Revolution Radio"#"Green Day - Still Breathing"

$ sdm remove album Green Day - Revolution Radio
sdm remove v0.1.0
[1/2] Removing album "Green Day - Revolution Radio"...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.

$ sdm why song Green Day - Still Breathing
sdm why v0.1.0
[1/4] Why do we have the song "Green Day - Still Breathing"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found song "Green Day - Still Breathing"
info This song exists because it's specified in "dependencies".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment