Add shell-deps subcommand to tw#218
Conversation
|
This is untested other than what claude did. The idea is just to be able to identify dependencies of a shell script that are missing. Ideally, I'd ultimately like to be able to point it at a image and have it spit out things that it thinks are missing. Right now it only handles local files or directory tree. |
kranurag7
left a comment
There was a problem hiding this comment.
sorry for coming late on this, great work Scott
It would be awesome to have scan supported on files and directories both then we can do things like fd -e sh -x tw shell-deps scan
dc0eae4 to
a445274
Compare
|
@Aditevil , From our meet session, think we came up with:
|
|
So I think basically, what I'm asaying we want in tw shell-deps is 3 sub-commands, all which take '--path' argumetn rather than --missing.
maybe we still keep 'show' to just show fuller output and not check deps? we can ditch scan for now.. that was to be pointed at a full image, we can maybe add it back later when its needed. |
|
this doesn't seem right: i have vim intsalled, i wanted it to check all the shell scripts installed by vim. |
18e5ec0 to
fc9a287
Compare
This is a pattern I often use to execute a functions parameters after logging them.
Signed-off-by: Aditya Tirmanwar <aditya.tirmanwar@chainguard.dev>
…dency validation Signed-off-by: Aditya Tirmanwar <aditya.tirmanwar@chainguard.dev>
Signed-off-by: Aditya Tirmanwar <aditya.tirmanwar@chainguard.dev>
Signed-off-by: Aditya Tirmanwar <aditya.tirmanwar@chainguard.dev>
Invoking via symlink as seen below would show usage error after failure
in parsing.
./bin/shell-deps check --path=/usr/local/bin /tmp/my-script
a8024c0 to
838db14
Compare
|
@Aditevil i pushed one change that fixed the symlink usage I think I'm pretty happy with this. then we need to get someone else's review and land this.l |
raised a draft PR for this - https://github.com/chainguard-dev/stereo/pull/13152 |
shell-deps parses shell scripts and determines dependencies.
See README.md for more info.