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

feat: add save_file.sh #25

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Changes from all 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
16 changes: 16 additions & 0 deletions tools/save_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e

# @describe Saves the contents to a file called `file_name` and returns the file path if successful.
# @option --file-name! The name of the file to save to.
# @option --contents! The contents to save.

main() {
base_dir="$LLM_FUNCTIONS_DIR/tmp/files"
output_file="$base_dir/$argc_file_name"
mkdir -p "$base_dir"
echo "$argc_contents" > "$output_file"
echo "$output_file"
}

eval "$(argc --argc-eval "$0" "$@")"