toumorokoshi / tome

convert any directory of scripts into your own fully-featured command.
MIT License
38 stars 2 forks source link

Python script doesn't receive args #16

Closed hilkins closed 2 years ago

hilkins commented 3 years ago

I'm switching from sub to tome to take advantage of the nesting (e.g. my-command nested nested cmd) but it seems that scripts doesn't receive the arguments passed when calling the tome instance.

I have this setup:

.zshrc

eval "$(tome init my-tome ~/my-scripts zsh)"

~/my-scripts/python-test

#!/usr/bin/env python
import sys

print(sys.argv)

When I run the script through tome I get:

▶ my-tome python-test 1 2 3 4
['/home/hwbb/my-scripts/python-test']

Instead of:

▶ my-tome python-test 1 2 3 4
['/home/hwbb/my-scripts/python-test', '1', '2', '3', '4']
toumorokoshi commented 3 years ago

Hey! Thanks for the report.

I didn't have a chance to look last night, but will take a look in the next couple days.

This use case should work, and I have anecdotal experience this does work with other scripts (albeit not this specific script).

Nattle commented 3 years ago

Just jumping in to say that a) I use tome a lot and appreciate it and b) that I also have the same issue where I don't get args. (I'm using bash if that matters)

hilkins commented 2 years ago

Hey @toumorokoshi, any news on this ?

I've tried again and it does work properly with source scripts.

~/my-scripts/source-test

# SOURCE
echo $*
▶ my-tome source-test 1 2 3 4
1 2 3 4
toumorokoshi commented 2 years ago

Hey @toumorokoshi, any news on this ?

Sorry about that!

I found the bug, it was pretty straightforward. Doh!

I'll work on getting a release out. Unfortunately I no longer have access to a Mac, so that may slow the release for OSX, but I'm working on it.

toumorokoshi commented 2 years ago

So I have a release on 0.7.3. Unfortunately I was only able to compile Linux.

I have an OSX machine on the way but that'll probably take a week. Apologies about that. Rust is pretty easy to build locally if you find you can't wait.

hilkins commented 2 years ago

Thanks a lot, it's working properly now :)