ape
ape copied to clipboard
Allow folders inside the script folder to be scripts
Overview
Inside your scripts folder, create a new folder called new_folder
, and add a script called run_script.py
in there. Running tree .
you should see something like:
.
├── README.md
├── ape-config.yaml
├── contracts
├── scripts
├── new_folder
└── run_script.py
In that, add the code:
def main():
print("What's up")
Then try to run that script:
ape run scripts/new_folder/run_script.py
And it won't print What's up
Does it have a failure?
Also, can you try adding __init__.py
files inside both directories?
Yes and Yes
Error: No such command 'scripts/new_folder/run_script.py'.
Or
Error: No such command 'run_script'.
Can confirm this. Root cause is it doesn't walk the full directory right now in https://github.com/ApeWorX/ape/blob/main/src/ape_run/_cli.py#L115
@PatrickAlphaC is https://github.com/ApeWorX/ape/issues/804 a duplicate?
@NotPeopling2day yep. I'm idiot.
Closing as duplicate