Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding file tree tome and update bad reference in docs #438

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_docs/user-guide/golem.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can leverage the power of Eldritch with minimal exposure in the system proce
## Try it out

```bash
git clone git@github.com:KCarretto/realm.git
git clone git@github.com:spellshift/realm.git
cd realm/implants/golem
cargo run -- -i
# - or -
Expand Down
19 changes: 19 additions & 0 deletions tavern/tomes/file_tree/main.eldritch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def file_list(path,tree):
tree="|\t\t"+tree
if file.is_dir(path):
files = file.list(path)
for f in files:
type_str = ""
if f['type'] == "Directory":
print(tree+"|---"+path+"/"+f['file_name']+"\n")
file_list(path+"/"+f['file_name'],tree)
if f['type'] == "File":
print(tree+"|---"+f['file_name']+"\n")
else:
print("Error: Invalid Path ("+path+")\n")

tree=""
print(input_params['path']+"\n")
file_list(input_params['path'],tree)
print("\n")
print("\n")
7 changes: 7 additions & 0 deletions tavern/tomes/file_tree/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: List file tree
description: List the files and directories found at the path in tree-like format
paramdefs:
- name: path
type: string
label: File path
placeholder: "/etc/"
Loading